Animator Controller 允许您为角色或对象安排和维护一组动画剪辑以及关联的动画过渡。在大多数情况下,拥有多个动画并在满足某些游戏条件时在这些动画之间切换是很常见的。例如,只要按下空格键,就可以从行走动画剪辑切换到跳跃动画剪辑。但是,即使您仅有一个动画剪辑,仍需要将其放入 Animator Controller 以便将其用于游戏对象。
The Animator Controller has references to the Animation clips used within it, and manages the various Animation Clips and the Transitions between them using a State Machine, which could be thought of as a flow-chart of Animation Clips and Transitions, or a simple program written in a visual programming language within Unity. More information about state machines can be found here.
开始使用 Animation 窗口对游戏对象进行动画化时,或者将动画剪辑附加到游戏对象时,Unity 会自动创建 Animator Controller。
To manually create an Animator Controller, right-click within either column of the Project window and select Create > Animator Controller.
Use the scroll wheel to zoom in and zoom out of the Animator Controller window.
要聚焦 Animator Controller 窗口中的某一项,请选择一个或多个状态(单击要选择的状态或在其周围拖动选框),然后按 F 键来放大所选项。
按 A 键可将所有动画状态调整到 Animator Controller 视图中。
Unity 将保存您的选择。按 A 和 F 键可在所选动画状态与整个 Animator Controller 之间切换。
在播放模式期间,Animator 会平移视图,以便始终能看到正在播放的当前状态。Animator Controller 遵循基础层和子状态机的独立缩放因子,而窗口将自动平移以确保活动状态的可见性。
要在播放模式下修改缩放,请遵循以下步骤:
请注意,Animator Controller 在激活时会平移到每个状态。
AnimatorController
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.