在 Animator 窗口中可创建、查看和修改 Animator Controller 资源。
Animator 窗口有两个主要部分:主要网格化布局区域以及左侧 Layers 和 Parameters 面板。
The main section with the dark grey grid is the layout area. You can use this area to create, arrange and connect states in your Animator Controller.
您可以右键单击该网格以创建新的状态节点。使用鼠标中键或按住 Alt/Option 键拖拽可平移视图。通过单击可选择状态节点以进行编辑,而通过单击并拖动状态节点可重新排列状态机的布局。
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.
When the left-hand pane is switched to Layers view, you can create, view and edit layers within your Animator Controller. This allows you to have multiple layers of animation within a single animation controller working at the same time, each controlled by a separate state machine. A common use of this is to have a separate layer playing upper-body animations over a base layer that controls the general movement animations for a character.
要添加层,请单击加号图标。要删除层,请选择该层并按 Delete 键。
单击“眼睛”图标开关即可显示或隐藏 Parameters 和 Layers 侧面板,从而为您提供更多空间来查看和编辑状态机。
The “breadcrumb” hierarchical location within the current state machine. States can contain sub-states and trees and these structures can be nested repeatedly. When drilling down into sub states, the hierarchy of parent states and the current state being viewed is listed here. Clicking on the parent states allows you to jump back up to parent states or go straight back to the base layer of the state machine.
启用锁图标将使 Animator 窗口聚焦于当前状态机。锁图标为关闭状态时,如果单击新的 Animator 资源或带有 Animator 组件的游戏对象,则会切换 Animator 窗口以显示该项的状态机。锁定该窗口后,无论选择其他任何资源或游戏对象,Animator 窗口均一直显示同一状态机。