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");
}

//一个层容纳两个动作

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-11-13
  • 2022-12-23
  • 2022-01-10
  • 2021-11-02
  • 2021-07-04
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2021-12-09
  • 2021-06-03
  • 2021-12-28
  • 2022-02-03
  • 2021-08-09
相关资源
相似解决方案