- Home /
Guitexture disable not working second time
hi, i'm working on creating a menu, whereby when a user click the mouse, the guitexture of menuA will be disable and instantiate menu B. from the menu B, the user can go back to the menu A by clicking a button in menu B. the problem is, when I click the menuA for the first time, all the guitexture in menuA is gone(the script is working), but when i return from menuB to menuA, and i click the mouse, menuB will be instantiate but the guitexture(all the menuA guitexture) are still showing.Hope somebody can help me. Thank you
private GUITexture startm; private GUITexture title; private GUITexture startins; : : : void Awake(){ startm = GameObject.FindGameObjectWithTag("startb").guiTexture; title = GameObject.FindGameObjectWithTag("titleb").guiTexture; startins = GameObject.FindGameObjectWithTag("instb").guiTexture; }// end function awake : : :
IEnumerator OnMouseUp()
{ st1.Stop ();
startm.enabled = false;
title.enabled = false;
startins.enabled = false;
yield return new WaitForSeconds (3.5f);
Instantiate (page2);
Instantiate (retbutton);
m1.clip = AudioInstr;
m1.Play();