浏览代码

weaktime从击飞结束开始计时

LAPTOP-OM1V99U2\永远de小亡灵 11 月之前
父节点
当前提交
c74a38940a
共有 1 个文件被更改,包括 22 次插入21 次删除
  1. 22 21
      ActionTowerDefense/Assets/Scripts/Enemy.cs

+ 22 - 21
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -475,38 +475,39 @@ public class Enemy : MoveCharacter
                 }
                 else
                 {
-                    if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "weak")
+                    if (weakTime <= 0)
                     {
-                        ani.Play("weak",0,0);
-                        aniCollider.Play("Weak",0,0);
-                        rb.velocity = Vector3.zero;
-                    }
-
-                }
-                if (weakTime <= 0)
-                {
-                    if (upFirstAfterWeaknessOrNot)
-                    {
-                        if (AdjustHeight())
+                        if (upFirstAfterWeaknessOrNot)
                         {
-                            ChangeState(CharacterState.Idle);
+                            if (AdjustHeight())
+                            {
+                                ChangeState(CharacterState.Idle);
+                            }
+                            else
+                            {
+                                if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "walk")
+                                {
+                                    ani.Play("walk", 0, 0);
+                                    aniCollider.Play("Walk", 0, 0);
+                                }
+                            }
                         }
                         else
                         {
-                            if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "walk")
-                            {
-                                ani.Play("walk", 0, 0);
-                                aniCollider.Play("Walk", 0, 0);
-                            }
+                            ChangeState(CharacterState.Idle);
                         }
+                        break;
                     }
                     else
                     {
-                        ChangeState(CharacterState.Idle);
+                        if (ani.GetCurrentAnimatorClipInfo(0)[0].clip.name != "weak")
+                        {
+                            ani.Play("weak", 0, 0);
+                            aniCollider.Play("Weak", 0, 0);
+                            rb.velocity = Vector3.zero;
+                        }
                     }
-                    break;
                 }
-
                 break;
             case CharacterState.Coma:
                 pastComaTime += Time.deltaTime;