wulifu 1 年間 前
コミット
4cc4301dc7

+ 14 - 5
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -384,13 +384,22 @@ public class Enemy : MoveCharacter
 
     public void DropSouls()
     {
-        for (int i = 0; i < dropSoul; i++)
+        if (dropSoul > 1)
+        {
+            for (int i = 0; i < dropSoul; i++)
+            {
+                float angleInterval = dropSoulAngle / (float)(dropSoul - 1);
+                float angle = 90 + ((float)i - (float)(dropSoul - 1) / 2) * angleInterval;
+                angle = angle / 180 * Mathf.PI;
+                GameObject soulObj = PoolManager.Instantiate(soulPrefab, transform.position);
+                Vector3 dir = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0);
+                soulObj.GetComponent<Soul>().Burst(dir * soulStartSpeed);
+            }
+        }
+        else
         {
-            float angleInterval = dropSoulAngle / (float)(dropSoul - 1);
-            float angle = 90 + ((float)i - (float)(dropSoul - 1) / 2) * angleInterval;
-            angle = angle / 180 * Mathf.PI;
             GameObject soulObj = PoolManager.Instantiate(soulPrefab, transform.position);
-            Vector3 dir = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0);
+            Vector3 dir = Vector3.up;
             soulObj.GetComponent<Soul>().Burst(dir * soulStartSpeed);
         }
     }

+ 3 - 0
ActionTowerDefense/ProjectSettings/TagManager.asset

@@ -65,6 +65,9 @@ TagManager:
   - name: Player
     uniqueID: 2564701437
     locked: 0
+  - name: Soul
+    uniqueID: 21624701
+    locked: 0
   - name: UI
     uniqueID: 1516060329
     locked: 0