Skip to main content
Post Reopened by Kromster, user1430
added 20 characters in body; edited tags; edited title
Source Link
user1430
user1430

How can I disable an NGUI Button still working When Game Pausebutton when I pause my game?

There is an NGUI Buttonbutton in my game, which when i pressed that button. it increaseincreases the playerplayer's power. When i

When I press the escape key., my game pausepauses completely. but NguiBut the button still working(like Hover, Clicking, TweenScaling)

void Update () {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 want that Button shouldI'd like the button to be deactivatedeactivated when the game pauseis paused. itIt should be visible, but not be clickingclickable or scalinganything. How can I achieve that?

NGUI Button still working When Game Pause

There is NGUI Button in my game, when i pressed that button. it increase the player power. When i press escape key. my game pause completely. but Ngui button still working(like Hover, Clicking, TweenScaling)

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 want that Button should be deactivate when game pause. it should be visible but not be clicking or scaling.

How can I disable an NGUI button when I pause my game?

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?

added 549 characters in body
Source Link
Aks
  • 131
  • 5

How to disableThere is NGUI buttonButton in my game, when i pressed that button. it increase the player power. When i press escape key. my game pause? completely. Timebut Ngui button still working(like Hover, Clicking, TweenScaling)

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 want that Button should be deactivate when game pause.timescale does it should be visible but not work on NGUIbe clicking or scaling.

How to disable NGUI button when game pause?. Time.timescale does not work on NGUI.

There is NGUI Button in my game, when i pressed that button. it increase the player power. When i press escape key. my game pause completely. but Ngui button still working(like Hover, Clicking, TweenScaling)

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 want that Button should be deactivate when game pause. it should be visible but not be clicking or scaling.

Post Closed as "Needs details or clarity" by user1430
Source Link
Aks
  • 131
  • 5

NGUI Button still working When Game Pause

How to disable NGUI button when game pause?. Time.timescale does not work on NGUI.