Unity 2022.3.4f1中Button无法工作,EventSystem无输入响应
核心问题分析
报错ArgumentException: Input Button Submit is not setup表明旧Input Manager中缺少Submit输入轴的配置,默认的StandaloneInputModule依赖该轴判断是否激活模块,直接导致EventSystem无法正常工作,进而Button点击失效。
具体修复步骤
方法1:补全Input Manager的Submit轴配置
- 打开Unity顶部菜单:
Edit→Project Settings→Input Manager - 在
Axes列表中,若找不到Submit项:- 增加
Size数值,新建一个输入轴 - 将该轴的
Name设为Submit Positive Button设置为return(回车键),可按需添加其他触发按键Type选择Key or Mouse Button,其余参数保持默认
- 增加
- 保存设置后运行场景,测试Button点击是否恢复正常
方法2:替换EventSystem的输入模块
如果不想配置旧Input Manager的轴,可直接更换输入模块:
- 选中场景中的
EventSystem对象 - 删除默认的
StandaloneInputModule组件 - 添加
TouchInputModule组件(该模块适配鼠标和触屏交互,不依赖旧Input Manager的轴配置) - 运行场景测试Button功能
方法3:处理新Input System的兼容问题
若项目启用了新Input System(通过Package Manager安装):
- 打开
Edit→Project Settings→Player - 在
Other Settings中找到Active Input Handling,设置为Both或Input System Package (New) - 给EventSystem添加
InputSystemUIInputModule组件(需先在Package Manager中安装Input System包) - 移除原有的
StandaloneInputModule,运行测试
内容的提问来源于stack exchange,提问作者DetVarInteJag
相关产品推荐
相关产品推荐

