public class Menu : MonoBehaviour
{
public bool QuitButton = false;
public AudioClip Click;
public Texture2D normalTexture;
public Texture2D rollOverTexture;
public int levelToLoad;
void OnMouseEnter()
{
guiTexture.texture = rollOverTexture;
}
void OnMouseExit()
{
guiTexture.texture = normalTexture;
}
void OnMouseDown()
{
audio.PlayOneShot(Click);
if (QuitButton)
{
Application.Quit();
}
else
{
Application.LoadLevel (levelToLoad);
}
}
}
This is my simple menu script. It works inside the Editor during testing purposes but after I do a build it never works. I believe it is because I get a "Reference on this Behavior is Missing" Error. Any clues on why?