在项目中使用Input System,在UI中添加了元素后,再次运行出现下面的错误:
InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
在Hierarchy中选中EventSystem,可以看到如下提示:
You are using StandaloneInputModele, which uses the old InputManager. You are using the new InputSystem, and have the old InputManager disabled. StandaloneInputModule will not work. Click the button below to replace this component with a InputSystemUIInputModule, which uses the new InputSystem.
您正在使用 StandaloneInputModele,它使用旧的 InputManager。您正在使用新的 InputSystem,并且已禁用旧的 InputManager。StandaloneInputModule 将不起作用。单击下面的按钮将此组件替换为使用新 InputSystem 的 InputSystemUIInputModule。