Animator Controller 允许您为角色或对象安排和维护一组动画剪辑以及关联的动画过渡。在大多数情况下,拥有多个动画并在满足某些游戏条件时在这些动画之间切换是很常见的。例如,只要按下空格键,就可以从行走动画剪辑切换到跳跃动画剪辑。但是,即使您仅有一个动画剪辑,仍需要将其放入 Animator Controller 以便将其用于游戏对象。
Animator Controller 引用其中所用的动画剪辑,使用__状态机__来管理各种动画剪辑和它们之间的过渡;状态机可视为动画剪辑和过渡的一种流程图,或者是在 Unity 中使用可视化编程语言编写的简单程序。可在此处找到有关状态机的更多信息。
开始使用 Animation 窗口对游戏对象进行动画化时,或者将动画剪辑附加到游戏对象时,Unity 会自动创建 Animator Controller。
要手动创建 Animator Controller,请右键单击 Project 窗口,然后单击 Create > Animator Controller。
使用鼠标滚轮或类似功能可放大和缩小 Animator Controller 窗口。
要聚焦 Animator Controller 窗口中的某一项,请选择一个或多个状态(单击要选择的状态或在其周围拖动选框),然后按 F 键来放大所选项。
按 A 键可将所有动画状态调整到 Animator Controller 视图中。
Unity 将保存您的选择。按 A 和 F 键可在所选动画状态与整个 Animator Controller 之间切换。
在播放模式期间,Animator 会平移视图,以便始终能看到正在播放的当前状态。Animator Controller 遵循基础层和子状态机的独立缩放因子,而窗口将自动平移以确保活动状态的可见性。
要在播放模式下修改缩放,请遵循以下步骤:
请注意,Animator Controller 在激活时会平移到每个状态。
2017–11–21 页面已发布
在 2017.3 中添加了 Animator 缩放 NewIn20173
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.