Эх сурвалжийг харах

修复了水猴子死亡特效延迟的bug

HY-LSZNWIN10\Administrator 2 сар өмнө
parent
commit
e76177b96b

+ 2 - 1
ActionTowerDefense/Assets/Resources/Prefab/Enemy/Enemy_Polliwog.prefab

@@ -832,7 +832,7 @@ MonoBehaviour:
   mecanim: {fileID: 251812277556731043}
   meshRenderer: {fileID: 0}
   ani: {fileID: 1487103345711223088}
-  totalDieKeepTime: 0.1
+  totalDieKeepTime: 0
   totalAttack_summonTime: 1
   totalAttack_marchTime: 1
   showInjuryNum: 1
@@ -930,6 +930,7 @@ MonoBehaviour:
   type: 0
   searchState: 0
   attackRatio: 0
+  len: 0
   dropSoulMax: 0
   dropSoulMin: 0
   dropProbability: 30

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

@@ -479,7 +479,6 @@ public class AttackController : MonoBehaviour
         curKeyNum = 0;
         SetNextKeyTimes();
         attackTrigger.attackInfo = attackInfo;
-        Debug.Log("¹¥»÷");
         owner.ChangeState(CharacterState.Attack);
     }
 
@@ -515,7 +514,6 @@ public class AttackController : MonoBehaviour
         }
         else if (isAttackTriggerOn && attackKeyCount >= nextEndKeyTime)
         {
-            Debug.Log("¹¥»÷¹Ø±Õ");
             isAttackTriggerOn = false;
             attackTrigger.gameObject.SetActive(false);
             SetNextKeyTimes();

+ 26 - 19
ActionTowerDefense/Assets/Scripts/Characters/Monkey.cs

@@ -49,7 +49,7 @@ public class Monkey : Enemy
             return;
         }
         ChangeMonkeyState(MonkeyState.None);
-        Debug.Log("常态状态机,从" + state + "切换到" + newState);
+        //Debug.Log("常态状态机,从" + state + "切换到" + newState);
         switch (state)
         {
             case CharacterState.Run:
@@ -101,12 +101,20 @@ public class Monkey : Enemy
                 currentAnimation = "attack";
                 break;
             case CharacterState.Die:
+                Debug.Log("死亡");
                 //ani.Play("die", 0, 0);
                 isWaitTank = false;
                 ChangeAnimation("die",0);
                 isDie = true;
                 dieKeepTime = totalDieKeepTime;
                 DropSouls();
+                if (killer != null && killer.GetComponent<Demonic>())
+                {
+                    SoldierType st = killer.GetComponent<Demonic>().soldierType;
+                    SoldierEXP.expInstance.AddEXP(st, (int)(exp * LevelSelect.EXPRatio + 0.5f));
+                }
+                PoolManager.Instantiate(dieEffect, transform.position);
+                gameObject.SetActive(false);
                 break;
             case CharacterState.HitStun:
                 isWaitTank = false;
@@ -128,7 +136,7 @@ public class Monkey : Enemy
         {
             return;
         }
-        Debug.Log("猴子状态机,从" + monkeyState + "切换到" + newState);
+        //Debug.Log("猴子状态机,从" + monkeyState + "切换到" + newState);
         ChangeState(CharacterState.None);
         switch (monkeyState)
         {
@@ -405,22 +413,22 @@ public class Monkey : Enemy
                             transform.rotation = targetQt;
                         }
                         break;
-                    case CharacterState.Die:
-                        if (dieKeepTime <= 0)
-                        {
-                            if (killer != null && killer.GetComponent<Demonic>())
-                            {
-                                SoldierType st = killer.GetComponent<Demonic>().soldierType;
-                                SoldierEXP.expInstance.AddEXP(st, (int)(exp * LevelSelect.EXPRatio + 0.5f));
-                            }
-                            if (dieEffect)
-                            {
-                                PoolManager.Instantiate(dieEffect, transform.position);
-                            }
-                            gameObject.SetActive(false);
-                            break;
-                        }
-                        break;
+                    //case CharacterState.Die:
+                    //    if (dieKeepTime <= 0)
+                    //    {
+                    //        if (killer != null && killer.GetComponent<Demonic>())
+                    //        {
+                    //            SoldierType st = killer.GetComponent<Demonic>().soldierType;
+                    //            SoldierEXP.expInstance.AddEXP(st, (int)(exp * LevelSelect.EXPRatio + 0.5f));
+                    //        }
+                    //        if (dieEffect)
+                    //        {
+                    //            PoolManager.Instantiate(dieEffect, transform.position);
+                    //        }
+                    //        gameObject.SetActive(false);
+                    //        break;
+                    //    }
+                    //    break;
                     case CharacterState.HitStun:
                         hitFeedbackSystem.HitStunUpdate();
                         break;
@@ -452,7 +460,6 @@ public class Monkey : Enemy
                 //        break;
                 //    }
                 //}
-                Debug.Log(111);
                 velocity.x = -escapeSpeed;
                 if (bodyTrans.localScale.x < 0)
                 {