c# - 停止检测 Unity 中的输入?

标签 c# unity3d

如何停止检测 Unity 中用户的输入?我想实现以下目标:在 C# 中“不检测 Input.GetMouseButtonDown”?

最佳答案

您不能只是“关闭”Unity 提供的 Input 类的输入。相反,在您处理输入的地方,添加一个 if 语句。

例如:

void Update() {
    if (gameState != GameState.PAUSED) {
        if (Input.getMouseButtonDown(0)) {
            Debug.Log("Handle click!");
        }
    }
}

关于c# - 停止检测 Unity 中的输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33581217/

相关文章:

c# - Win32 用户模拟好奇心

c# - 可以与 WCF 交互的 Java Web 服务工具包

android - Unity游戏白屏

powershell - Unity.exe 命令行构建需要 10 分钟,而编辑器只需不到一分钟

unity3d - 统一:How to check if area inside camera view?

c# - 如何根据宽度值获取字符串部分?

c# - 无法将 ASP.NET MVC 5 Controller 添加到 VS2013 中的简单 ASP.NET MVC 项目

c# - 如何根据名称删除标签/按钮? WPF Visual Studio 2015

android - java.lang.NoClassDefFoundError Firebase和Unity

c# - Unity3d SimpleJSON 添加 int 到 JSONClass