[英]error CS0246: The type or namespace name 'UnityEngine' could not be found
[英]issue importing UnityEngine.InputSystem. Error CS0246 type or namespace not found
尽管完全复制了教程的代码,但我无法运行我的代码。
这是视频。 代码可见11:37。
我在 2 或 3 天前安装了 unity,所以我怀疑这是一个更新问题(我在另一个线程上看到有人这么说)
using System.Collections;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine;
public class controle : MonoBehaviour
{
private PlayerControls controls; // the error points at this line, at whatever position the "PlayerControls" string is
private void Awake()
{
controls = new PlayerControls();
controls.Gameplay.Forward.performed += Forward;
}
void Forward()
{
transform.position.z -= 1.1 * f;
}
void OnEnable()
{
controls.Gameplay.Enable();
}
void OnDisable()
{
controls.Gameplay.Disable();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.