Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Game Whiz on September 03, 2012, 10:45:25 AM

Title: 2.1.6 broke my UI in Unity 4.0b7
Post by: Game Whiz on September 03, 2012, 10:45:25 AM
Hi,

Just updated from 2.1.4 to 2.1.6 and UI events are not being detected in objects that start deactivated and get activated in runtime.

My UI has several NGUI UI's that I activate/deactivate when needed. When the game starts everything works fine, but as soon as I deactivate the starting GUI and activate another one, the newly activated one doesn't respond to any input.

How can I fix this?

Best regards,
Alex
Title: Re: 2.1.6 broke my UI in Unity 4.0b7
Post by: Game Whiz on September 03, 2012, 10:53:32 AM
It appears that using the deprecated SetActiveRecursively for my NGUI UI's solves this issue.
Title: Re: 2.1.6 broke my UI in Unity 4.0b7
Post by: Game Whiz on September 04, 2012, 08:07:11 AM
Aren, there's a bug in NGUITools.GetActive. You should return go.activeInHierarchy instead of go.activeSelf, since activeSelf may be true, even though the object is deactivated (e.g. in my case a game object's parent was set to false and it was returning true, causing my gui to stop working).
Title: Re: 2.1.6 broke my UI in Unity 4.0b7
Post by: PhilipC on September 04, 2012, 08:32:54 AM
Yea I wasnt 100% sure which one was going to work properly as Unity's documentation was not so good on the subject. I tried with the .activeSelf and everything seemed to be working as expected so wasnt to worried about it.

Thanks.
Title: Re: 2.1.6 broke my UI in Unity 4.0b7
Post by: ArenMook on September 04, 2012, 04:04:48 PM
When in doubt, Blame Philâ„¢

:D
Title: Re: 2.1.6 broke my UI in Unity 4.0b7
Post by: Game Whiz on September 04, 2012, 05:02:00 PM
"When in doubt, Blame Philâ„¢"

Yeah, that should be here: http://www.tasharen.com/forum/index.php?topic=776.0

:)