Parcourir la source

融魂技根据有无使魔出现不同的特效

LAPTOP-OM1V99U2\永远de小亡灵 il y a 10 mois
Parent
commit
b20a8c7efe

+ 15 - 1
ActionTowerDefense/Assets/Scripts/Conduct/ConductReadyTip.cs

@@ -6,10 +6,12 @@ public class ConductReadyTip : MonoBehaviour
 {
     public bool isShowing0;
     public bool isShowing1;
+    public bool isShowingNoDemonic;
     public GameObject starFx;
     public GameObject star_endFx;
     private float time;
     public float closeFx;
+    public GameObject[] noDemonic;
     private void Start()
     {
         starFx.SetActive(false);
@@ -36,7 +38,15 @@ public class ConductReadyTip : MonoBehaviour
             }
         }
     }
-    public void Show(int id)
+    public void activeFalse()
+    {
+        for (int i = 0; i < 3; i++)
+        {
+            noDemonic[i].SetActive(false);
+        }
+        isShowingNoDemonic = false;
+    }
+    public void Show(int id,int demonicId = -1)
     {
         switch (id)
         {
@@ -54,6 +64,10 @@ public class ConductReadyTip : MonoBehaviour
                 star_endFx.SetActive(false);
                 star_endFx.SetActive(true);
                 break;
+            case 2:
+                isShowingNoDemonic = true;
+                noDemonic[demonicId].SetActive(true);
+                break;
         }
         
     }

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

@@ -706,18 +706,46 @@ public class PlayerController : MoveCharacter
             if(conductTime >= totalCacheSummonTime + canConductTime[nowConductButton] * timeSlowingMultiplier)
             {
                 isReadyConduct = true;
-                if (!conductReadyTip.isShowing1)
+                if (!conductReadyTip.isShowing1 && !conductReadyTip.isShowingNoDemonic)
                 {
-                    conductReadyTip.Show(1);
+                    int boostNum = demonicDic[nowConductButton].Count;
+                    int dienum = Mathf.RoundToInt(boostNum * conversionRate[nowConductButton]);
+                    if (boostNum == 1)
+                    {
+                        dienum = 1;
+                    }
+                    if (dienum > 0)
+                    {
+                        conductReadyTip.Show(1);
+                    }
+                    else
+                    {
+                        conductReadyTip.Show(3, nowConductButton);
+                    }
+                        
                 }
                 
             }
             else if( conductTime >= totalCacheSummonTime + (canConductTime[nowConductButton] - readyTipFxTime) * timeSlowingMultiplier)
             {
-                if (!conductReadyTip.isShowing0)
+                if (!conductReadyTip.isShowing0 && !conductReadyTip.isShowingNoDemonic)
                 {
                     Time.timeScale = timeSlowingMultiplier;
-                    conductReadyTip.Show(0);
+                    int boostNum = demonicDic[nowConductButton].Count;
+                    int dienum = Mathf.RoundToInt(boostNum * conversionRate[nowConductButton]);
+                    if (boostNum == 1)
+                    {
+                        dienum = 1;
+                    }
+                    if (dienum > 0)
+                    {
+                        conductReadyTip.Show(0);
+                    }
+                    else
+                    {
+                        conductReadyTip.Show(2, nowConductButton);
+                    }
+
                 }
 
             }
@@ -900,6 +928,7 @@ public class PlayerController : MoveCharacter
         else
         {
             print("ʹħ²»×ã");
+            conductReadyTip.activeFalse();
         }
     }