This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
/* | |
* source: http://unity3d.com/learn/tutorials/modules/beginner/5-pre-order-beta/state-machine-behaviours | |
* | |
* The core of state machine behaviours are 5 functions that are automatically called whilst in an animator state and 2 functions that are automatically called whilst in a sub-state machine. | |
* Commented out versions of some of these functions are added to new state machine behaviours when they are created. These functions are OnStateEnter, OnStateUpdate, OnStateExit, OnStateMove and OnStateIK. | |
* The additional functions for sub-state machine transitions are OnStateMachineEnter and OnStateMachineExit. | |
* All of these functions have 3 parameters passed to them: an Animator, an AnimatorStateInfo and the layer index |