Browse Source

使魔层级配置功能

wulifu 1 year ago
parent
commit
288408796a

+ 4 - 5
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Arrow.prefab

@@ -979,26 +979,22 @@ MonoBehaviour:
     attackDir: {x: -1, y: 0, z: 0}
     force: 0
     changeHurt: 0
-    hurtTime: 0.3
     repelValue: 10
   - damage: 20
     attackDir: {x: -1, y: 0, z: 0}
     force: 0
     changeHurt: 0
-    hurtTime: 0.3
     repelValue: 10
   - damage: 40
     attackDir: {x: -1, y: 0, z: 0}
     force: 0
     changeHurt: 0
-    hurtTime: 0.3
     repelValue: 10
   attack2Infos:
   - damage: 10
     attackDir: {x: -1, y: 0, z: 0}
     force: 0
     changeHurt: 0
-    hurtTime: 0
     repelValue: 0
   attackTriggers: []
   attackType: 1
@@ -1017,7 +1013,6 @@ MonoBehaviour:
   searchTrigger: {fileID: 3566347593191160092}
   targetTypes: 0400000005000000
   canHitFly: 1
-  hurtKeepTime: 0
   foot: {fileID: 8639832132450015562}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -1028,11 +1023,15 @@ MonoBehaviour:
   totalWeakTime: 3
   weakUpSpeed: 10
   decelerationRatio: 1
+  minHurtKeepTime: 0.2
+  hurtKeepTime: 0
+  hurtChangeVelocity: 1
   id: 0
   costMp: 60
   searchState: 0
   attackDistance: 10
   canFly: 1
+  sortingOrder: 2000
 --- !u!54 &8639832132491289349
 Rigidbody:
   m_ObjectHideFlags: 0

+ 5 - 4
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Sword.prefab

@@ -185,14 +185,12 @@ MonoBehaviour:
     attackDir: {x: -1, y: 0, z: 0}
     force: 1000
     changeHurt: 1
-    hurtTime: 0.5
     repelValue: 52
   attack2Infos:
   - damage: 100
     attackDir: {x: -1, y: 0, z: 0}
     force: 1000
     changeHurt: 0
-    hurtTime: 0
     repelValue: 0
   attackTriggers:
   - {fileID: 4347565098670608659}
@@ -209,7 +207,6 @@ MonoBehaviour:
   searchTrigger: {fileID: 5104552355235513707}
   targetTypes: 0400000005000000
   canHitFly: 0
-  hurtKeepTime: 0
   foot: {fileID: 2437299196663985756}
   extraRiseGravity: -28.8
   extraFallGravity: -14.4
@@ -219,11 +216,16 @@ MonoBehaviour:
   weakTime: 0
   totalWeakTime: 3
   weakUpSpeed: 10
+  decelerationRatio: 1
+  minHurtKeepTime: 0.2
+  hurtKeepTime: 0
+  hurtChangeVelocity: 1
   id: 0
   costMp: 100
   searchState: 0
   attackDistance: 1.5
   canFly: 0
+  sortingOrder: 1000
 --- !u!54 &2437299196472462355
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -561,7 +563,6 @@ MonoBehaviour:
   damage: 0
   force: {x: 0, y: 0, z: 0}
   changeHurt: 0
-  hurtTime: 0
   repelValue: 0
 --- !u!1 &7669620205589286043
 GameObject:

+ 1 - 0
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -11,6 +11,7 @@ public class Demonic : MoveCharacter
     public SearchState searchState;
     public float attackDistance;
     public bool canFly = false;
+    public int sortingOrder = 0;
 
     private void Awake()
     {

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

@@ -36,6 +36,7 @@ public class PlayerController : MoveCharacter
     public List<GameObject> demonicPrefabs;
     public List<Vector3> demonicSummonPos;
     public Dictionary<int, List<Demonic>> demonicDic;
+    public List<int> demonicId;
     public UIHP uiMp;
 
     public float jumpSpeed = 10;
@@ -196,6 +197,7 @@ public class PlayerController : MoveCharacter
             return;
         }
         demonicDic = new Dictionary<int, List<Demonic>>();
+        demonicId = new List<int>() { 0, 0, 0 };
         Init();
     }
 
@@ -1030,7 +1032,8 @@ public class PlayerController : MoveCharacter
             }
         }
         demonic.Init();
-        demonic.SetSortingOrder(id * 1000 + demonicDic[id].Count);
+        demonic.SetSortingOrder(demonic.sortingOrder + demonicId[id]);
+        demonicId[id]++;
         demonic.Attack1();
     }