Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: realblues on May 01, 2012, 08:04:40 AM
-
My Panel has several widgets like button, Inputs..
and several Panel exists in same position, it's visible only one Panel by situation.
to hide it, i use UIPanel.enabled, then images hide but collider still enabled, so new widgets not triggering well.
isn't it right way? should i use NGUITools.SetActive()?
-
Yeah, use NGUITools method. It will hide all children as well.
-
Thanks for Quick reply :)
-
Or use SetActiveRecursively(gameObject, true/false).
Difference with NGUITools.SetActive is that the NGUI version affects parents first, and the built in affects children first.
-
Depends on whether it's 'true' or 'false', Nicki. When enabling, parents are enabled before children. When disabling, children are disabled before parents.
Unity's built-in version doesn't do this, and always enables and disables in the same order, which can produce some odd effects.
-
Ah, I did not know that you change the order based on that.
Nonetheless, both can produce odd effects when you don't know (or expect) the behavior of it. :D