瀏覽代碼

蓝魂满了吃不了了

wgl 7 月之前
父節點
當前提交
fb7260cd01
共有 1 個文件被更改,包括 19 次插入8 次删除
  1. 19 8
      ActionTowerDefense/Assets/Scripts/Soul.cs

+ 19 - 8
ActionTowerDefense/Assets/Scripts/Soul.cs

@@ -54,19 +54,30 @@ public class Soul : MonoBehaviour
     public async void BeCollect(int id)
     {
         Spirits spirits = PlayersInput.instance[id].GetComponent<Spirits>();
-        if (isSourPurple && spirits.hasSpirits == 3)
+        if (isSourPurple)
         {
-            for(int i = 0; i < 3; i++)
+            if(spirits.hasSpirits == 3)
             {
-                if(type == spirits.ownSpirits[i])
-                {
-                    break;
-                }
-                if(i == 2) 
+                for (int i = 0; i < 3; i++)
                 {
-                    return;
+                    if (type == spirits.ownSpirits[i])
+                    {
+                        break;
+                    }
+                    if (i == 2)
+                    {
+                        return;
+                    }
                 }
             }
+
+        }
+        else
+        {
+            if(PlayersInput.instance[id].mp >= PlayersInput.instance[id].totalMp)
+            {
+                return;
+            }
         }
         collected = true;
         GetComponent<BoxCollider>().enabled = false;