Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: swilskey on June 01, 2014, 04:49:17 PM

Title: Enabled/Disabled Sprites
Post by: swilskey on June 01, 2014, 04:49:17 PM
I am having some problems with the Enabled Disabled sprites. The normal sprite always changes to the Disabled sprite. I am not sure exactly what is happening. I am using the newest NGUI. http://imgur.com/N3qq4Kf (http://imgur.com/N3qq4Kf)
Title: Re: Enabled/Disabled Sprites
Post by: ArenMook on June 01, 2014, 05:42:50 PM
Your collider is disabled. Disabled collider = disabled button.
Title: Re: Enabled/Disabled Sprites
Post by: swilskey on June 01, 2014, 07:07:44 PM
The problem is that when I enable the button it doesn't switch to the Normal button sprite. It can be enabled but still be the disabled sprite.
Title: Re: Enabled/Disabled Sprites
Post by: ArenMook on June 02, 2014, 10:30:25 PM
You need to use UIButton.isEnabled instead of modifying the collider's state, and it will update the sprite.
Title: Re: Enabled/Disabled Sprites
Post by: swilskey on June 11, 2014, 03:45:19 PM
Thanks that makes sense. I am however having trouble using the UIButton.isEnabled This is the current script I am using to get the info from player prefs and changing the collider. I am not sure what I need to change. (http://i.imgur.com/pZr8qWg.jpg)
Title: Re: Enabled/Disabled Sprites
Post by: ArenMook on June 12, 2014, 02:27:43 AM
Replace "collider.enabled = false;" with "GetComponent<UIButton>().isEnabled = false;"