Procházet zdrojové kódy

风筝忍者复活位置随机

1243896040 před 1 týdnem
rodič
revize
cc093aa457

+ 1 - 1
ActionTowerDefense/Assets/Resources/Prefab/ESpirits/ESpirits_KiteNinja.prefab

@@ -1717,7 +1717,7 @@ MonoBehaviour:
   dropSoulAngle: 60
   lockingLogic: {x: 1, y: 2}
   revivesNum: 2
-  revivesPos: {x: 10, y: 3}
+  revivesPos: {x: 10, y: 1}
   fleeDistance: 10
   fleeSpeedRate: {x: 0.8, y: 0.2}
   targetIsPlayer: 0

+ 5 - 1
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_KiteNinja.cs

@@ -40,10 +40,14 @@ public class ESpirits_KiteNinja : Enemy
                 else
                 {
                     Init();
-                    transform.position += new Vector3(
+                    Vector3 revivesPos = transform.position;
+                    revivesPos.y = flyHeight;
+                    revivesPos += new Vector3(
                         Random.Range(-revivesPos.x, revivesPos.x),
                         Random.Range(-revivesPos.y, revivesPos.y),
                         0);
+                    flyHeight = revivesPos.y;
+                    transform.position = revivesPos;
                 }
                 return;
             case CharacterState.Attack: