From 0acaafbebdb708e5d175c583e8d7874c6c3baba0 Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Fri, 8 Sep 2023 16:27:15 +0200 Subject: [PATCH] done (#541) --- Assets/Scripts/GameManager.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index b236959f9..419473c8d 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -763,7 +763,7 @@ namespace HeavenStudio IEnumerator SwitchGameIE(string game, double beat, bool flash) { - if(flash) + if (flash) { HeavenStudio.StaticCamera.instance.ToggleCanvasVisibility(false); } @@ -774,8 +774,16 @@ namespace HeavenStudio if (miniGame != null) miniGame.OnGameSwitch(beat); - //before beat-based: yield return new WaitForSeconds(0.1f); - yield return new WaitForSeconds(Conductor.instance.pitchedSecPerBeat / 4); + while(beat + 0.25 > Conductor.instance.songPositionInBeats) + { + if (!Conductor.instance.isPlaying) + { + HeavenStudio.StaticCamera.instance.ToggleCanvasVisibility(true); + SetAmbientGlowToCurrentMinigameColor(); + StopCoroutine(currentGameSwitchIE); + } + yield return null; + } HeavenStudio.StaticCamera.instance.ToggleCanvasVisibility(true); SetAmbientGlowToCurrentMinigameColor();