![](/img/trans.png)
[英]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.