[U3d][Animator]StateMachineBehaviour

StateMachineBehaviour是Unity3D中 Animator 状态机状态的组件基类,用于扩展状态机行为。它包含预定义的消息如OnStateEnter、OnStateExit等。默认情况下,Animator会为控制器中定义的每个行为实例化新实例,但通过SharedBetweenAnimatorsAttribute属性可以控制实例化行为。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

StateMachineBehaviour

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.


OnStateEnterCalled on the first Update frame when a statemachine evaluate this state.
OnStateExitCalled on the last update frame when a statemachine evaluate this state.
OnStateIKCalled right after MonoBehaviour.OnAnimatorIK.
OnStateMoveCalled right after MonoBehaviour.OnAnimatorMove.
OnStateUpdateCalled 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都可以。


OnStateEnterCalled on the first Update frame when a statemachine evaluate this state.
OnStateExitCalled on the last update frame when a statemachine evaluate this state.
OnStateIKCalled right after MonoBehaviour.OnAnimatorIK.
OnStateMoveCalled right after MonoBehaviour.OnAnimatorMove.
OnStateUpdateCalled at each Update frame except for the first and last frame.



使用

挂载需要监听的Animator.AnimationClip下。




使用

挂载需要监听的Animator.AnimationClip下。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值