فهرست منبع

敌方法师对英雄也造成漂浮效果

SZAND\msx_2 1 سال پیش
والد
کامیت
26f6e6a6ad

+ 5 - 3
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Float.prefab

@@ -963,10 +963,9 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   height: 7
-  intervalTime: 10
+  intervalTime: 20
+  followTime: 3
   lockTime: 3
-  waitTime: 1.5
-  lastTime: 10
   fe: {fileID: 417478504669294145, guid: 243eb0eff66414445990654286d861d1, type: 3}
   lockEffect: {fileID: 7959709114612421421, guid: 6d10e54fe2c6a92468d4458f98fea44e, type: 3}
 --- !u!54 &8639832132491289349
@@ -1087,6 +1086,8 @@ MonoBehaviour:
   searchState: 0
   attackDistance: 10
   canFly: 1
+  flyHeight: 0
+  flyUpSpeed: 10
   attackRatio: 0
   maxMoveSpeed: 12
   minMoveSpeed: 8
@@ -1094,3 +1095,4 @@ MonoBehaviour:
   soulPrefab: {fileID: 1723151111827507807, guid: e2b65aa482f2f1447a4074208d72b778, type: 3}
   soulStartSpeed: 100
   dropSoulAngle: 90
+  isSpiritsAttack: 0

+ 4 - 4
ActionTowerDefense/Assets/Scripts/MoveCharacter.cs

@@ -48,7 +48,7 @@ public class MoveCharacter : Character
     private Vector3 oneClockwise = new Vector3(0, 0, 1);
     private Vector3 oneCounterClockwise = new Vector3(0, 0, -1);
 
-    private int floatState; //0:不漂浮;1:漂浮中;2:飘着;3:掉下去
+    public int floatState; //0:不漂浮;1:漂浮中;2:飘着;3:掉下去
 
     private GameObject spine;
     private MeshRenderer mesh;
@@ -72,7 +72,6 @@ public class MoveCharacter : Character
         }
         if (state == 0)
         {
-            print(1);
             mesh.materials = outlineMats;
         }
         else
@@ -106,7 +105,7 @@ public class MoveCharacter : Character
     }
 
 
-    private void Update()
+    public void Update()
     {
         if (beLarger)
         {
@@ -132,7 +131,8 @@ public class MoveCharacter : Character
         {
             RotateSelf();
             curTime += Time.deltaTime;
-            transform.position = new Vector3(origPos.x + backSpeed * (curTime - pastTime), height, origPos.z);
+            origPos.x += backSpeed * (curTime - pastTime);
+            transform.position = new Vector3(origPos.x, height, origPos.z);
             if (curTime >= floatTime)
             {
                 floatState = 3;

+ 4 - 0
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -320,6 +320,10 @@ public class PlayerController : MoveCharacter
         {
             isKeepBtnRush = true;
         }
+        if (floatState != 0)
+        {
+            base.Update();
+        }
     }
 
 

+ 2 - 0
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Float.cs

@@ -13,6 +13,7 @@ public class ESpirits_Float : MonoBehaviour
 
     [Header("漂浮锁定玩家")]
     public float intervalTime = 10f;  //漂浮间隔时间
+    public float firstAttackTime = 2f;  //第一次攻击距出场的时间
     private Vector3 attackPos;        //漂浮中心
     public float followTime = 3;        //跟随玩家时间
     public float lockTime = 1.5f;     //锁定等待时间
@@ -50,6 +51,7 @@ public class ESpirits_Float : MonoBehaviour
     {
         origPos = transform.position;
         curHeight = origPos.y;
+        pastTime = intervalTime - firstAttackTime;
     }
 
     private void OnDisable()