There is an NGUI button in my game, which when pressed increases the player's power.
When I press the escape key, my game pauses completely. But the button still functions normally. Here's how I check for pausing:
void Update ()
{
if(Input.GetKeyDown("escape"))
{
if(isPaused && Time.timeScale == 1.0f){
Time.timeScale = 0.0f;
AudioListener.volume = 1;
}
else
{
Time.timeScale = 1.0f;
AudioListener.volume = 0;
}
}
}
I'd like the button to be deactivated when the game is paused. It should be visible, but not be clickable or anything. How can I achieve that?