Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: KyleStaves on June 01, 2013, 12:56:38 PM

Title: UIImageButton disabled doesn't always work based on order of operations
Post by: KyleStaves on June 01, 2013, 12:56:38 PM
Hello,

I just wanted to submit a quick bug/fix. Depending on how the execution order goes, it's possible for a UIImageButton to immediately flicker back from the disabled sprite to the hover sprite (my script calls imageButton.isEnabled = false, then within the same frame the UICamera passes the OnHover event to the ImageButton). I fixed this locally by asking if (enabled && isEnabled && target != null) instead of if (enabled && target != null) in the OnHover method of ImageButton.cs

Not sure if you want to add this to the main release or if there's a more efficient way to fix the issue, just thought it may help someone (and hopefully it does get included so I don't have to remember to re-fix upon updating :D).

Best,
Kyle
Title: Re: UIImageButton disabled doesn't always work based on order of operations
Post by: ArenMook on June 01, 2013, 03:23:38 PM
The latest version has it at "if (isEnabled && target != null)". You should update!
Title: Re: UIImageButton disabled doesn't always work based on order of operations
Post by: KyleStaves on June 01, 2013, 06:27:05 PM
Oh excellent, thanks!