[unity]加入动画的一些代码

private Animator animator;

- start

animator = GetComponent ();

- update

//检测速度,然后执行

animator.SetFloat ("velocityX", Mathf.Abs (velocity.x))

你可能感兴趣的:([unity]加入动画的一些代码)