动画层的应用

function Start ()
{
   animation.wrapMode = WrapMode.Loop;
   animation["jump"].wrapMode = WrapMode.Once;
   animation["jump"].layer = 1;
   animation.Stop();
}

function Update ()
{
   if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1)
      animation.CrossFade("run");
   else
      animation.CrossFade("walk");

   if (Input.GetKeyDown ("space"))
      animation.CrossFade("jump");
}

//一个层容纳两个动作

原文地址:https://www.cnblogs.com/softimagewht/p/1906957.html