I’m trying to make a main menu screen, but when I hover over the “Play Game” or “Quit” button, the color changes in preview but not in game. Here’s the code I’m using. I don’t use a function update because the OnMouseEnter and OnMouseExit beacuse they should be self updating. Please help, thanks!
var isQuitButton = false ;
function OnMouseOver()
{
renderer.material.color = Color.green;
}
function OnMouseExit()
{
renderer.material.color = Color.black;
}
function OnMouseUp()
{
//are we dealing with a quit button
if( isQuitButton)
{
//quit the game
Application.Quit();
}
else
{
//load level
Application.LoadLevel(1);
}
}