Hi,
I have this code on my word:
function Update () {
renderer.material.color = Color.red;
}
But this is on a Start Game button so when I put this code on it also:
var isQuit=false;
function OnMouseEnter(){
//change text color
renderer.material.color=Color.grey;
}
function OnMouseExit(){
//change text color
renderer.material.color=Color.red;
}
function OnMouseUp(){
//is this quit
if (isQuit==true) {
//quit the game
Application.Quit();
}
else {
//load level
Application.LoadLevel(0);
}
}
function Update(){
//quit game if escape key is pressed
if (Input.GetKey(KeyCode.Escape)) { Application.Quit();
}
}
And this part of the code does not work:
function OnMouseEnter(){
//change text color
renderer.material.color=Color.grey;
}
function OnMouseExit(){
//change text color
renderer.material.color=Color.red;
}
I think this is because the first code is blocking out the grey. How do I fix this?