Skip to content

Instantly share code, notes, and snippets.

@Gojeflone
Created February 17, 2014 02:27
Show Gist options
  • Save Gojeflone/9043678 to your computer and use it in GitHub Desktop.
Save Gojeflone/9043678 to your computer and use it in GitHub Desktop.
If Statements and boo leans in Unity
var myCheck : boolean = true;
function Update () {
if(myCheck){
guiText.text = "Its on!";
}else{
guiText.text = "Its Off!";
}
if(Input.GetButtonUp("Jump") && myCheck){
myCheck = false;
}else if(Input.GetButtonUp("Jump") && myCheck == false){
myCheck = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment