__动画状态__是__动画状态机__的基本组成模块。每个状态包含一个单独动画序列(或混合树);此序列将在角色处于该状态时播放。游戏中的事件触发状态转换时,角色将处于新状态,随后会替换其动画序列。
在 Animator Controller 中选择某个状态时,Inspector 中将显示该状态的属性:
属性: | 功能: |
---|---|
Speed | 动画的默认速度 |
Motion | 分配给此状态的动画剪辑 |
Foot IK | 此状态下是否遵循 Foot IK。适用于人形动画。 |
Write Defaults | AnimatorStates 是否为其运动执行未动画化的属性写回默认值。 |
Mirror | 是否为状态生成镜像。这仅适用于人形动画。 |
Transitions | 源自此状态的过渡的列表 |
以棕色显示的默认状态是状态机首次激活时所处的状态。必要时,可通过右键单击另一状态并从上下文菜单选择 Set As Default 来更改默认状态。每个过渡上的 Solo 和 Mute 复选框用于控制__动画预览__的行为,请参阅本页面以了解更多详细信息。
可通过右键单击 Animator Controller 窗口__中的空白区域并从上下文菜单选择 Create State > Empty__ 来添加新状态。或者,也可将动画拖到 Animator Controller 窗口中,从而创建包含该动画的状态。(请注意,只能将 Mecanim 动画拖到控制器中,非 Mecanim 动画将被拒绝。)状态还可包含混合树。
任意状态 (Any State) 是一个始终存在的特殊状态。此状态适用于您想要进入特定状态的情况(无论您当前处于哪个状态)。这是向状态机中的所有状态添加相同外向过渡的简便方法。请注意,__任意状态__的特殊含义意味着它不能成为过渡的端点(即,不能通过跳到“任意状态”选择下一步要进入的随机状态)。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.