I am following will goldstones Unity 3.x book and my script doesn’t seem to work, but I get no errors.
Here’s the code
else if (menuPage == "instructions")
{
Debug.Log ("does it work?");
GUI.Label(new Rect(instructions),
"You awake on a mysterious island... Find a way to signal for help or face certain doom!");
Debug.Log("doesitwork2?");
if(GUI.Button(new Rect(quitButton), "Back"))
{
Debug.Log ("doesitwork3");
audio.PlayOneShot(beep);
menuPage="main";
}
}
The first two debug.logs work perfectly, but the third doesn’t run at all. Also, all of the text in the label doesn’t seem to show up at all, but no errors. I don’t think that
“if(GUI.Button(new Rect(quitButton), “Back”))” runs at all. I keep looking over the book but I don’t see any differences between what I have and what the book has.
Anyone have an Idea?