From d0d8d8e95ebd0c0caa9bd8aedbb92bfbacb80b95 Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Mon, 11 Mar 2024 15:24:11 -0400 Subject: [PATCH] trygetminigame it's from a different branch but it's nice to have rn --- Assets/Scripts/GameManager.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 2ce1d7a65..1db820d34 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -1243,6 +1243,17 @@ namespace HeavenStudio return eventCaller.GetMinigame(name); } + public bool TryGetMinigame(out T mg) where T : Minigame + { + if (minigame is T tempMinigame) { + mg = tempMinigame; + return true; + } else { + mg = null; + return false; + } + } + Color colMain; public void SetCurrentGame(string game, bool useMinigameColor = true) {