From c18d5353c5a1531998c6f89ef992fff438ddba83 Mon Sep 17 00:00:00 2001 From: Zeo <67521686+ThatZeoMan@users.noreply.github.com> Date: Fri, 7 Apr 2023 10:15:19 -0500 Subject: [PATCH] gameswitch flash toggle (#387) vfx boutta pop off --- Assets/Scripts/GameManager.cs | 11 +++++++---- Assets/Scripts/Minigames.cs | 8 ++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 0e1346a1..6cdbb002 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -657,19 +657,22 @@ namespace HeavenStudio #endregion - public void SwitchGame(string game, float beat) + public void SwitchGame(string game, float beat, bool flash) { if (game != currentGame) { if (currentGameSwitchIE != null) StopCoroutine(currentGameSwitchIE); - currentGameSwitchIE = StartCoroutine(SwitchGameIE(game, beat)); + currentGameSwitchIE = StartCoroutine(SwitchGameIE(game, beat, flash)); } } - IEnumerator SwitchGameIE(string game, float beat) + IEnumerator SwitchGameIE(string game, float beat, bool flash) { - this.GetComponent().enabled = true; + if(flash == true) + { + this.GetComponent().enabled = true; + } SetGame(game); diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index d349a301..c0e31c4c 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -259,8 +259,12 @@ namespace HeavenStudio new Minigame("gameManager", "Game Manager", "", false, true, new List() { new GameAction("switchGame", "Switch Game", 0.5f, false, - function: delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame, eventCaller.currentEntity.beat); }, - inactiveFunction: delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame, eventCaller.currentEntity.beat); } + function: delegate { var e = eventCaller.currentEntity; GameManager.instance.SwitchGame(eventCaller.currentSwitchGame, eventCaller.currentEntity.beat, e["toggle"]); }, + parameters: new List() + { + new Param("toggle", true, "Black Flash", "Enable or disable the black screen for this Game Switch") + }, + inactiveFunction: delegate { var e = eventCaller.currentEntity; GameManager.instance.SwitchGame(eventCaller.currentSwitchGame, eventCaller.currentEntity.beat, e["toggle"]); } ), new GameAction("end", "End Remix", function: delegate {