Changing the code to the following did
not work (sometimes has child labels,buttons, etc not visible). I am only switching the active panel I'm not changing/moving any of the buttons/labels underneath or anything like that. Just swapping out which panel is visible.
IEnumerator switchActivePanel(UIPanel activate, UIPanel deactivate) {
root.animation.Play();
yield return new WaitForSeconds
(.15f
);
NGUITools.SetActive (deactivate.gameObject, false);
NGUITools.SetActive (activate.gameObject, true);
NGUITools.MarkParentAsChanged (activate.gameObject);
}
Just to make sure I'm explaining it clearly I have a Main Menu system like below (below is simplified but same idea).
-UIRoot
-UIMainPanel
-LabelTitle
-PanelButton1
-PanelButton2
-UIOptionsPanel
-LabelOptionsTitle
-PanelButtons
Only one panel is ever enabled at a time and I'm using the above function to try and switch the panels. However, sometimes the buttons under the panels don't become visible (though they are enabled). I've looked at your example menu included and it does originally have the options panel disabled and then you enable it, although at first glance it looks like your animations do the work not code (I couldn't actually find where the options panel got enabled in the example so I assume its the animation).
In my project the animation is just a generic quick fade to black and then back on the UIRoot I don't really want to make custom animations for all the panels as in the future I envision I'll have quite a few. Any advice/guidance would be appreciated.