在 Animator 窗口中可创建、查看和修改 Animator Controller 资源。
Animator 窗口有两个主要部分:主要网格化布局区域以及左侧 Layers 和 Parameters 面板。
带有深灰色网格的主要部分是布局区域。使用此区域可在Animator Controller中创建、排列和连接状态。
You can right-click on the grid to create a new state node. Use the middle mouse button or Alt/Option drag to pan the view around. Click to select state nodes to edit them, and click & drag state nodes to rearrange the layout of your state machine.
The left-hand pane can be switched betwen Parameters view and Layers view. The parameters view allows you to create, view and edit the Animator Controller Parameters. These are variables you define that act as inputs into the state machine. To add a parameter, click the Plus icon and select the parameter type from the pop up menu. To delete a parameter, select the parameter in the lists and press the delete key (on macOS use fn-Delete to delete the selected parameter).
左侧面板切换到 Layers 视图时,您可以在 Animator Controller 中创建、查看和编辑层。因此,可在单个动画控制器中同时运行多个动画层,每个动画层由一个单独状态机控制。此情况的常见用途是在控制角色一般运动动画的基础层之上设置一个单独层来播放上身动画。
要添加层,请单击加号图标。要删除层,请选择该层并按 Delete 键。
单击“眼睛”图标开关即可显示或隐藏 Parameters 和 Layers 侧面板,从而为您提供更多空间来查看和编辑状态机。
当前状态机内的“示踪导航”分层位置。状态可包含子状态和树,这些结构可以反复嵌套。当进入子状态时,此处会列出父状态的层级视图以及当前查看的状态。单击父状态可跳回到父状态或直接返回到状态机的基础层。
启用锁图标将使 Animator 窗口聚焦于当前状态机。锁图标为关闭状态时,如果单击新的 Animator 资源或带有 Animator 组件的游戏对象,则会切换 Animator 窗口以显示该项的状态机。锁定该窗口后,无论选择其他任何资源或游戏对象,Animator 窗口均一直显示同一状态机。
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.