View difference between Paste ID: tqfPjvWz and NHAcudpw
SHOW: | | - or go back to the newest paste.
1
	/// <summary>
2-
	/// Checks to see if a given key is pressed, and if it is, change to the given state.
2+
	/// Checks to see if a given key is pressed, and if it is, change to the given state and also increase the steps counter.
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
			steps++;
11
		}
12
	}