Animator Controller
动画控制器,实现动画状态机。
如 entry-idle-run 之间的动画关系
idle 和 run 可以相互转换 通过 动画 parameter Bool Run来设置

设置 动画状态 转换 条件 后 代码就可以这样控制动画
Animator ani ;
// Use this for initialization
void Start()
{
ani = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if(Input.GetKey(KeyCode.W))
{
ani.SetBool("Run", true);
}
if (Input.GetKey(KeyCode.S))
{
ani.SetBool("Run", false);
}
转换条件有个选项Has Exit Time ,如果勾上 那么就会等待当前动画执行完成后才转换,
否则立即转换