panel hide and show in NGUI

I have two panels in in ui root. Panel1 and Panel2.
Panel2 is deactivated in scene.
In panel1 i have a play button, that is image button.
Clicking on panel1, panel1 should get hide and panel2 should show.
In which script and how can i do it?
Thanks in advance.

1 Answer

1

void OnClick(){
GameObject panel2 = GameObject.Find(“Panel2”);
NGUITools.SetActive(panel2,true);
GameObject panel1 = GameObject.Find(“Panel1”);
NGUITools.SetActive(panel1,false);

}