Created
July 1, 2016 03:39
-
-
Save teach310/dfff56f797526d11592a12cc746af9b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int currentState = 0; // 0:Angry 1:Smile | |
void Update () { | |
// state : Angry | |
if (currentState == 0) { | |
Debug.Log ("Angry!"); | |
//Smileになる条件 | |
if (Input.GetKeyDown (KeyCode.S)) { | |
currentState = 1; | |
} | |
} | |
// state : Smile | |
if (currentState == 1) { | |
Debug.Log ("Smile!"); | |
//Angryになる条件 | |
if (Input.GetKeyDown (KeyCode.A)) { | |
currentState = 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment