Im working on a doodle jump type of game. And when you die some UI elements show up(like a restart button). If i use the button.enable = false; the you can
t touch the button, but its still there. How can I make it so that the button is completely invisible? Here
s the code Im using(don
t mind the other stuff, that works fine):
#pragma strict
var PP : GameObject;
var isDead: boolean = false;
var deadScreen : UI.Image;
var restartButton : UI.Button;
var mainMenuButton : UI.Button;
function Update () {
if(PP.transform.position.y < transform.position.y - 6)
{
isDead = true;
}
if(isDead)
{
Time.timeScale = 0;
deadScreen.enabled = true;
restartButton.enabled = true;
mainMenuButton.enabled = true;
}
if(!isDead)
{
deadScreen.enabled = false;
restartButton.enabled = false;
mainMenuButton.enabled = false;
if(PP.transform.position.y + 2 > transform.position.y)
{
rigidbody.velocity.y = PP.rigidbody.velocity.y;
}
else
{
rigidbody.velocity.y = 0;
}
}
}