Reputation:
How can I stop detecting input from the user in Unity? I want to achieve the following: "do not detect Input.GetMouseButtonDown
" In C#?
Upvotes: 1
Views: 1523
Reputation: 2910
You can't just "turn off" input from the Input
class Unity provides. Instead, at where you handle input, add an if statement.
Eg:
void Update() {
if (gameState != GameState.PAUSED) {
if (Input.getMouseButtonDown(0)) {
Debug.Log("Handle click!");
}
}
}
Upvotes: 3