Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: stevej on November 14, 2012, 11:09:39 PM
-
Is there any known problems with the latest NGUI and Unity 4?
My project uses NGUITools.SetActive() pretty heavily when a scene loads to enable and disable certain parts of the interface. In Unity 3.5 this is all good, but in Unity 4 it's like all of that code is just ignored. I had the same problem early on using the first betas.
Any ideas?
-
I'm also still getting the same problems that I posted about here:
http://www.tasharen.com/forum/index.php?topic=1472.msg7613#msg7613
(there's a video in that thread showing the issue).
-
From Unity changelog:
We have changed how the active state of GameObjects is handled. GameObjects active state will now affect child GameObjects, so setting a GameObject to inactive will now turn the entire sub-hierarchy inactive. This may change the behavior of your projects. GameObject.active and GameObject.SetActiveRecursively() have been deprecated. Instead, you should now use the GameObject.activeSelf and GameObject.activeInHierarchy getters and the GameObject.SetActive() method.
-
I believe NGUITools.SetActive() was added to work around problems with SetActiveRecursively(). So with these new Unity changes, should we go back to using the built in stuff or continue with NGUITools.SetActive()?
-
NGUITools.SetActive works exactly the same in Unity4 as setting gameObject.activeSelf. Be sure to grab the latest version though (2.2.6).
-
Yep - running the latest NGUI. Just can't put my finger on why it's different under Unity 4 compared to 3.5..........
-
In Unity 3.5 NGUI was disabling the entire hierarchy of game object. In Unity 4.0, NGUI only disables the top-most object (as it's now a cumulative state).
-
Not entirely sure what you mean - so there's no way to disable the child objects at the same time now? It has to be done manually?
-
It's cumulative. As in, if a parent is disabled, the children are now automatically disabled.
-
So the end result should be the same... so, still not sure why what I'm doing works in 3.5 but not in 4 :)