Browse Source

敌方刺客英灵和隐身英灵的死亡

LAPTOP-OM1V99U2\永远de小亡灵 1 year ago
parent
commit
17b8fbc99f

+ 4 - 1
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Assassin.cs

@@ -22,7 +22,10 @@ public class ESpirits_Assassin : MonoBehaviour
         {
             OnState();
         }
-        
+        if(enemy.state == CharacterState.Die)
+        {
+            this.enabled = false;
+        }
     }
     public void OnState()
     {

+ 11 - 0
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Invisible.cs

@@ -9,6 +9,7 @@ public enum InvisibleState
     FindSoul = 2,   //冷산榴檄
     FindPlayer = 3, //冷鯤소
     Boom = 4,   //괵珞
+    Die = 5,    //价空
 }
 public class ESpirits_Invisible : MonoBehaviour
 {
@@ -50,6 +51,10 @@ public class ESpirits_Invisible : MonoBehaviour
     {
         OnState();
         //print(SoulInMap.souls.Count);
+        if (enemy.hp <= 0)
+        {
+            ChangeState(InvisibleState.Die);
+        }
     }
     void OnState()
     {
@@ -182,6 +187,12 @@ public class ESpirits_Invisible : MonoBehaviour
                 followEffect.Boom();
                 haveSoulNumber = 0;
                 break;
+            case InvisibleState.Die:
+                enemy.isDie = true;
+                enemy.dieKeepTime = enemy.totalDieKeepTime;
+                enemy.DropSouls();
+                gameObject.SetActive(false);
+                break;
             default:
                 break;
         }