Advertisement
Tkrain42

Consider_state

Jul 30th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1.     /// <summary>
  2.     /// Checks to see if a given key is pressed, and if it is, change to the given state.
  3.     /// </summary>
  4.     /// <param name="key">Key. (KeyCode.whateverkey</param>
  5.     /// <param name="newState">New state. (States.newstate)</param>
  6.     void Consider_state (KeyCode key, States newState)
  7.     {
  8.         if (Input.GetKeyDown (key)) {
  9.             myState = newState;
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement