diff --git a/Assets/Scripts/RoundController.cs b/Assets/Scripts/RoundController.cs index 9fa186f303f86276a86166827ad89c8489e7bbe7..2bedf018166a925e3dcbcd6fe182f686fd159fad 100644 --- a/Assets/Scripts/RoundController.cs +++ b/Assets/Scripts/RoundController.cs @@ -23,10 +23,11 @@ public class RoundController : MonoBehaviour, IFighterCallback BaseCameraController cameraController; int aliveEnemiesCount = 0; float targetRoundGameSpeed = 1f; + bool inRoundEndAnimation = false; public void StartRound() { - if (roundRunning) + if (roundRunning || inRoundEndAnimation) { return; } @@ -46,7 +47,7 @@ public class RoundController : MonoBehaviour, IFighterCallback public void StopRound() { - if (!roundRunning) + if (!roundRunning || inRoundEndAnimation) { return; } @@ -102,6 +103,7 @@ public class RoundController : MonoBehaviour, IFighterCallback if (isAntiPlayer || aliveEnemiesCount == 0) { // Slowmo-zoom to last dying Figher + inRoundEndAnimation = true; var targetGameSpeed = 0.2f; SetCurrentGameSpeed(targetGameSpeed); cameraController.AnimateToPosition(fighter.transform.position + new Vector3(0f, 0.75f), 1.5f, 0.125f * targetGameSpeed); @@ -111,6 +113,7 @@ public class RoundController : MonoBehaviour, IFighterCallback void StopRoundAfterDeath() { + inRoundEndAnimation = false; StopRound(); cameraController.AnimateToPosition(new Vector3(0, 0, 0), 5f, 0.15f); }