diff --git a/Assets/Scenes/Forest.unity b/Assets/Scenes/Forest.unity index 822040a8d6e70315818cf8f3f5bc2acd6f2c1662..528c8a9d8f8005f869b33fa4407dd3e7ef27ffde 100644 --- a/Assets/Scenes/Forest.unity +++ b/Assets/Scenes/Forest.unity @@ -3362,7 +3362,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 579686565} m_TargetAssemblyTypeName: RoundController, Assembly-CSharp - m_MethodName: SetGameSpeed + m_MethodName: SetRoundSpeed m_Mode: 0 m_Arguments: m_ObjectArgument: {fileID: 0} diff --git a/Assets/Scripts/RoundController.cs b/Assets/Scripts/RoundController.cs index 387210144fcf1ba92491cd637d2571c76faa597b..9fa186f303f86276a86166827ad89c8489e7bbe7 100644 --- a/Assets/Scripts/RoundController.cs +++ b/Assets/Scripts/RoundController.cs @@ -22,6 +22,7 @@ public class RoundController : MonoBehaviour, IFighterCallback BaseCameraController cameraController; int aliveEnemiesCount = 0; + float targetRoundGameSpeed = 1f; public void StartRound() { @@ -30,7 +31,7 @@ public class RoundController : MonoBehaviour, IFighterCallback return; } roundRunning = true; - SetGameSpeed(1f); + SetCurrentGameSpeed(targetRoundGameSpeed); roundCallbacks.ForEach(c => c.OnRoundStart()); aliveEnemiesCount = 0; @@ -50,7 +51,7 @@ public class RoundController : MonoBehaviour, IFighterCallback return; } roundRunning = false; - SetGameSpeed(1f); + SetCurrentGameSpeed(1f); roundCallbacks.ForEach(c => c.OnRoundEnd()); } @@ -66,11 +67,16 @@ public class RoundController : MonoBehaviour, IFighterCallback } } - public void SetGameSpeed(float multiplier) + public void SetCurrentGameSpeed(float multiplier) { Time.timeScale = multiplier; } + public void SetRoundSpeed(float multiplier) + { + targetRoundGameSpeed = multiplier; + } + void Awake() { if (instance == null) @@ -97,7 +103,7 @@ public class RoundController : MonoBehaviour, IFighterCallback { // Slowmo-zoom to last dying Figher var targetGameSpeed = 0.2f; - SetGameSpeed(targetGameSpeed); + SetCurrentGameSpeed(targetGameSpeed); cameraController.AnimateToPosition(fighter.transform.position + new Vector3(0f, 0.75f), 1.5f, 0.125f * targetGameSpeed); Invoke(nameof(StopRoundAfterDeath), targetGameSpeed * restartDelayAfterLastFighterDeath); }