You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unity 2022.3.4f1中Button无法工作,EventSystem无输入响应

解决Unity Button无法点击且EventSystem无输入响应的问题

核心问题分析

报错ArgumentException: Input Button Submit is not setup表明旧Input Manager中缺少Submit输入轴的配置,默认的StandaloneInputModule依赖该轴判断是否激活模块,直接导致EventSystem无法正常工作,进而Button点击失效。

具体修复步骤

方法1:补全Input Manager的Submit轴配置

  1. 打开Unity顶部菜单:Edit → Project Settings → Input Manager
  2. 在Axes列表中,若找不到Submit项:
    • 增加Size数值,新建一个输入轴
    • 将该轴的Name设为Submit
    • Positive Button设置为return(回车键),可按需添加其他触发按键
    • Type选择Key or Mouse Button,其余参数保持默认
  3. 保存设置后运行场景,测试Button点击是否恢复正常

方法2:替换EventSystem的输入模块

如果不想配置旧Input Manager的轴,可直接更换输入模块:

  1. 选中场景中的EventSystem对象
  2. 删除默认的StandaloneInputModule组件
  3. 添加TouchInputModule组件(该模块适配鼠标和触屏交互,不依赖旧Input Manager的轴配置)
  4. 运行场景测试Button功能

方法3:处理新Input System的兼容问题

若项目启用了新Input System(通过Package Manager安装):

  1. 打开Edit → Project Settings → Player
  2. 在Other Settings中找到Active Input Handling,设置为Both或Input System Package (New)
  3. 给EventSystem添加InputSystemUIInputModule组件(需先在Package Manager中安装Input System包)
  4. 移除原有的StandaloneInputModule,运行测试

内容的提问来源于stack exchange,提问作者DetVarInteJag

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 15:12:47