示例#1
0
 private void ChangeAnimation(string name, bool play = true)
 {
     if (SpriteRenderer.Animation.Name != name)
     {
         if (play)
         {
             SpriteRenderer.Play(name);
         }
         else
         {
             SpriteRenderer.SetAnimation(name);
             SpriteRenderer.Stop();
         }
     }
 }