Support => NGUI 3 Support => Topic started by: TicTac on October 16, 2013, 10:26:56 AM
Title: Enabling Object after disable
Post by: TicTac on October 16, 2013, 10:26:56 AM
Hello, I'm trying to manage enabling and disabling panels in my UI. So I am able to disable using: NGUITools.SetActive(GameObject.FindWithTag("newairlinepanel") as GameObject, false); and also NGUITools.SetActive(newairlinepanel, false); using a predefined gameobject and dragging it on.
But I cannot enable in the same way. I understand that I need to keep a reference to the panel I am disabling, how do I go about this? Heres my hierarchy, the panels I'm interested in are the children of manager_panel
(http://i.imgur.com/joq5dtd.png?1)
Title: Re: Enabling Object after disable
Post by: ArenMook on October 16, 2013, 01:01:41 PM
Basic Unity scripting question here.
usingUnityEngine;
publicclass MyScript : MonoBehaviour
{
public GameObject airplanePanelGO;
void DoStuff ()
{
NGUITools.SetActive(airplanePanelGO, false);
NGUITools.SetActive(airplanePanelGO, true);
}
}
Title: Re: Enabling Object after disable
Post by: TicTac on October 16, 2013, 01:49:33 PM
I already have this. I want to be able to start the scene with all panels hidden and to do this I have been unchecking the box in the editor on the object for showing/hiding. When I use the NGUITools.SetActive(newairline, true); It won't show it?
Title: Re: Enabling Object after disable
Post by: briermay on October 24, 2013, 11:47:39 PM
from what I understand is the panel manager tool in unity if you unchecka panel to hide it and run your game it becomes PERMANENTLY disabled and mostly is only usable to hide panels while your developing so they don't get in your way.
what I do is like this:
public GameObject LoginWindow;
public GameObject RegisterWindow;
then in my Awake or Start function I simply do this: