Type of instance in array does not match expected type UnityEngine.InputSystem.PlayerInput:OnDisable ()
(at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1734)
Edit manifest.json:
Change "com.unity.inputsystem": "1.4.2" to "com.unity.inputsystem": "1.3.0"
或者用下面的代码 没测试
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerInputErrorWorkaround : MonoBehaviour
{
private PlayerInput Input;
private void Start()
{
Input = GetComponent<PlayerInput>();
}
private void OnDisable()
{
Input.actions = null;
}
}