Explorar el Código

修复快速使用两个指挥技第二个特效不会出现问题

LAPTOP-OM1V99U2\永远de小亡灵 hace 10 meses
padre
commit
8372600905

+ 10 - 3
ActionTowerDefense/Assets/Scripts/Conduct/ConductReadyTip.cs

@@ -4,7 +4,7 @@ using UnityEngine;
 
 public class ConductReadyTip : MonoBehaviour
 {
-    private bool isShowing;
+    public bool isShowing;
     public GameObject starFx;
     private float time;
     private void Start()
@@ -25,8 +25,15 @@ public class ConductReadyTip : MonoBehaviour
     }
     public void Show()
     {
-        time = 0;
-        starFx.SetActive(true);
         isShowing = true;
+        starFx.SetActive(true);
+        starFx.GetComponent<ParticleSystem>().Simulate(0);
+        starFx.GetComponent<ParticleSystem>().Play();
+    }
+    public void Init()
+    {
+        starFx.SetActive(false);
+        isShowing = false;
+        time = 0;
     }
 }

+ 11 - 5
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -706,13 +706,19 @@ public class PlayerController : MoveCharacter
             {
                 isReadyConduct = true;
             }
-            else if(conductTime >= totalCacheSummonTime + (canConductTime[nowConductButton] - readyTipFxTime) * timeSlowingMultiplier)
+            else if( conductTime >= totalCacheSummonTime + (canConductTime[nowConductButton] - readyTipFxTime) * timeSlowingMultiplier)
             {
-                Time.timeScale = timeSlowingMultiplier;
-                conductReadyTip.Show();
+                if (!conductReadyTip.isShowing)
+                {
+                    Time.timeScale = timeSlowingMultiplier;
+                    conductReadyTip.Show();
+                }
+
+            }
+            else
+            {
+                conductReadyTip.Init();
             }
-            
-            
         }
 
         return false;