I am new to NGUI
and unity 3d
.
I have two panels in a ui
root. its named as firstPanel
and secondPanel
. secondPanel is deactivated in scene. In firstPanel
i have so many buttons and one is a play
button, that is image button. While Clicking on play
button, firstPanel
should get hide and secondPanel
should show.I adde a new Script to play
button and written code in it
void OnClick(){
GameObject panel2 = GameObject.Find("secondPanel");
NGUITools.SetActive(panel2,true);
GameObject panel1 = GameObject.Find("firstPanel");
NGUITools.SetActive(panel1,false);
}
But I get this Error : "NullReferenceException"
In which script of ngui
i have to edit and how can i do it? please help me to solve this issue
Thanks in advance.