Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们正在寻找一种在 BGE 中编写事件脚本的方法,而不是在 GUI 版本中使用您使用鼠标使事件触发您的脚本的方式。没有办法直接在 python 中使用事件吗?提前致谢。
绕过 BGE 事件系统的唯一方法是使用 Python 读取事件(这本质上是低效的)。
您可以读取键盘和鼠标事件或使用自己的算法验证场景。
我建议使用键盘传感器(allKeys 模式)触发依赖于键盘事件的代码,以获得更好的性能,而不是始终使用传感器。