Prechádzať zdrojové kódy

长按JKL进入慢动作

LAPTOP-OM1V99U2\永远de小亡灵 10 mesiacov pred
rodič
commit
6965348247

+ 2 - 0
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -1006,6 +1006,8 @@ MonoBehaviour:
   conductSkills: 010000000700000008000000
   conductCanRelease: 010101
   conductReadyTip: {fileID: 946637326309089849}
+  timeSlowingMultiplier: 0.5
+  readyTipFxTime: 0.2
   bigGiant: {fileID: 5440846222648032759, guid: d64528a2dcc945b4a9ea5d5a859679f3, type: 3}
   stageSize:
   - 1.5

+ 15 - 3
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -169,6 +169,8 @@ public class PlayerController : MoveCharacter
     public bool[] conductCanRelease;        //能否进入指挥技蓄力状态
     public ConductReadyTip conductReadyTip; //指挥技就绪
     private bool isReadyConduct;
+    [Header("时间倍率")] [Tooltip("时间速度放慢到正常的几倍")] public float timeSlowingMultiplier;
+    public float readyTipFxTime;
     //大胖子
     public GameObject bigGiant;
     public float[] stageSize;
@@ -694,10 +696,19 @@ public class PlayerController : MoveCharacter
             isReadyConduct = false;
             return true;
         }
-        if (!isReadyConduct && nowConductButton != -1 && conductTime >= canConductTime[nowConductButton]) 
+        if (!isReadyConduct && nowConductButton != -1) 
         {
-            conductReadyTip.Show();
-            isReadyConduct = true;
+            if(conductTime >= canConductTime[nowConductButton])
+            {
+                isReadyConduct = true;
+            }
+            else if(conductTime >= canConductTime[nowConductButton] - readyTipFxTime && conductTime >= totalCacheSummonTime)
+            {
+                Time.timeScale = timeSlowingMultiplier;
+                conductReadyTip.Show();
+            }
+            
+            
         }
 
         return false;
@@ -1835,6 +1846,7 @@ public class PlayerController : MoveCharacter
                 break;
             case CharacterState.Conduct:
                 rb.isKinematic = false;
+                Time.timeScale = 1;
                 break;
             default:
                 break;