Hello!
I tried to let a GUI appear when a integer reaches 0. Well, it appears on the normal canvas and not when the int. is set to 0.
My Code:
#pragma strict
public var TimeLeft : int = 750;
public var style : GUIStyle;
public var Shoot : AudioSource;
function Update(){
TimeLeft -= 1;
if(TimeLeft<0){
TimeLeft = 0;
}
if(TimeLeft == 0){
OnGUI();
if(Input.GetKey(KeyCode.E)){
Shoot.Play();
Application.LoadLevel(1);
}
}
}
function OnGUI(){
GUI.Label ( new Rect (10f, 100f, 200f, 50f), "Press E to give up", style);
}
How can I stop it?
~C8002