Description
StateMachineBehaviour is a component that can be added to a state machine state. It's the base class every script on a state derives from.
By default the Animator does instantiate a new instance of each behaviour define in the controller. The class attribute SharedBetweenAnimatorsAttribute control how behaviours are instantiated.
StateMachineBehaviour has some predefined messages:OnStateEnter, OnStateExit, OnStateIK, OnStateMove, OnStateUpdate.
OnStateEnter | Called on the first Update frame when a statemachine evaluate this state. |
OnStateExit | Called on the last update frame when a statemachine evaluate this state. |
OnStateIK | Called right after MonoBehaviour.OnAnimatorIK. |
OnStateMove | Called right after MonoBehaviour.OnAnimatorMove. |
OnStateUpdate | Called at each Update frame except for the first and last frame. |
描述
StateMachineBehaviour is a component that can be added to a state machine state. It's the base class every script on a state derives from.
StateMachineBehaviour脚本可以通过AddBehaviour添加到状态机的子状态下,state或者subState都可以。
By default the Animator does instantiate a new instance of each behaviour define in the controller. The class attribute SharedBetweenAnimatorsAttribute control how behaviours are instantiated.
StateMachineBehaviour has some predefined messages:OnStateEnter, OnStateExit, OnStateIK, OnStateMove, OnStateUpdate.
OnStateEnter | Called on the first Update frame when a statemachine evaluate this state. |
OnStateExit | Called on the last update frame when a statemachine evaluate this state. |
OnStateIK | Called right after MonoBehaviour.OnAnimatorIK. |
OnStateMove | Called right after MonoBehaviour.OnAnimatorMove. |
OnStateUpdate | Called at each Update frame except for the first and last frame. |
使用
挂载需要监听的Animator.AnimationClip下。
使用
挂载需要监听的Animator.AnimationClip下。