停止检测 Unity 中的输入?

Stop detecting Input in Unity?

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

您不能仅从 Input class Unity 提供的 "turn off" 输入。相反,在你处理输入的地方,添加一个 if 语句。

例如:

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