Răsfoiți Sursa

新增近战击中特效

WGL 2 luni în urmă
părinte
comite
f61d9052a0

+ 9 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits/ESpirits_Assassin.prefab

@@ -224,6 +224,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -285,6 +286,7 @@ MonoBehaviour:
       attackValue: 0
       damage: 10
       attackDir: {x: 0, y: 0, z: 0}
+      effect: {fileID: 0}
       attackEffect: 
       floatState:
         time: 0
@@ -350,6 +352,7 @@ MonoBehaviour:
       attackValue: 0
       damage: 0
       attackDir: {x: 0, y: 0, z: 0}
+      effect: {fileID: 7473170563405908938, guid: 8ad3c225050205945b10657aa300afd6, type: 3}
       attackEffect: 
       floatState:
         time: 0
@@ -416,6 +419,7 @@ MonoBehaviour:
       attackValue: 0
       damage: 0
       attackDir: {x: 0, y: 0, z: 0}
+      effect: {fileID: 0}
       attackEffect: 
       floatState:
         time: 0
@@ -947,6 +951,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -1213,6 +1218,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 7473170563405908938, guid: 8ad3c225050205945b10657aa300afd6, type: 3}
     attackEffect: 
     floatState:
       time: 0
@@ -1487,6 +1493,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -1535,6 +1542,7 @@ MonoBehaviour:
   isFly: 0
   decelerationRatioX: 2
   decelerationRatioY: 15
+  rotateCenterHeight: 1
   startFlyAngle: 15
   flyingRotateSpeedRange: {x: 15, y: 45}
   compressionDegree: 0.8
@@ -1571,6 +1579,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0

+ 9 - 0
ActionTowerDefense/Assets/Resources/Prefab/MySoldier/Spirits_Assassin.prefab

@@ -456,6 +456,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -517,6 +518,7 @@ MonoBehaviour:
       attackValue: 0
       damage: 500
       attackDir: {x: 0, y: 0, z: 0}
+      effect: {fileID: 7473170563405908938, guid: 8ad3c225050205945b10657aa300afd6, type: 3}
       attackEffect: 
       floatState:
         time: 0
@@ -582,6 +584,7 @@ MonoBehaviour:
       attackValue: 0
       damage: 10
       attackDir: {x: 0, y: 0, z: 0}
+      effect: {fileID: 0}
       attackEffect: 
       floatState:
         time: 0
@@ -648,6 +651,7 @@ MonoBehaviour:
       attackValue: 0
       damage: 0
       attackDir: {x: 0, y: 0, z: 0}
+      effect: {fileID: 0}
       attackEffect: 
       floatState:
         time: 0
@@ -1158,6 +1162,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -1424,6 +1429,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -1698,6 +1704,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0
@@ -1746,6 +1753,7 @@ MonoBehaviour:
   isFly: 0
   decelerationRatioX: 2
   decelerationRatioY: 15
+  rotateCenterHeight: 1
   startFlyAngle: 15
   flyingRotateSpeedRange: {x: 15, y: 45}
   compressionDegree: 0.8
@@ -1782,6 +1790,7 @@ MonoBehaviour:
     attackValue: 0
     damage: 0
     attackDir: {x: 0, y: 0, z: 0}
+    effect: {fileID: 0}
     attackEffect: 
     floatState:
       time: 0

+ 1 - 0
ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs

@@ -31,6 +31,7 @@ public class AttackInfo
     [LabelText("»÷´òÖµ")] public int attackValue;
     public int damage;
     public Vector3 attackDir;
+    [LabelText("»÷ÖÐÌØÐ§")] public GameObject effect;
     public AttackEffect[] attackEffect;
 
     //Ư¸¡

+ 7 - 0
ActionTowerDefense/Assets/Scripts/Characters/MoveCharacter.cs

@@ -302,6 +302,13 @@ public class MoveCharacter : Character
         //敌方士兵受起手式伤害/我方士兵受伤 闪白
         beHitTrigger.JudgeTurnWhite(attackInfo.isDemSummon, this);
 
+        //击中特效(如果有的话)
+        if (attackInfo.effect)
+        {
+            Vector3 effectPos = beHitTrigger.GetComponent<Collider>().bounds.center;
+            PoolManager.Instantiate(attackInfo.effect, effectPos);
+        }
+
         //伤害跳字
         if (showInjuryNum)
         {

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Spirits/Spirits_Assassin.cs

@@ -22,7 +22,7 @@ public class Spirits_Assassin : Demonic
     public override void Awake()
     {
         base.Awake();
-        dashTrigger.attackInfo.damage = attackController.attackMethod[0].attackInfo.damage;
+        //dashTrigger.attackInfo.damage = attackController.attackMethod[0].attackInfo.damage;
     }
     public override void Init()
     {
@@ -36,8 +36,8 @@ public class Spirits_Assassin : Demonic
             | RigidbodyConstraints.FreezeRotation;
         rb.useGravity = false;
         attackController.attackTime = totalAttack_summonTime;
-        attackController.attackTrigger.attackInfo = attackController.attackInfo;
         attackController.ChooseAttack(attackController.attackMethod[0].id);
+        attackController.attackTrigger.attackInfo = attackController.attackInfo;
         ChangeState(CharacterState.Attack);
         invincibleTime = totalAttack_summonTime;
         if (PlayersInput.instance[playerID].bodyTrans.localScale.x > 0)