From ef3b287beb07f3733227f90b8a89b1abbce76843 Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Thu, 3 Feb 2022 00:47:38 -0700 Subject: [PATCH] GameManager no longer attempts to load games that are "fxOnly" (gameManager, countIn, etc) --- Assets/Scripts/GameManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 8f27b91f..65f5e035 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -352,9 +352,20 @@ namespace RhythmHeavenMania public GameObject GetGame(string name) { - if (name == "gameManager" || name == "countIn") + var gameInfo = GetGameInfo(name); + if (gameInfo != null) { - name = Beatmap.entities.FindAll(c => c.datamodel.Split(0) != "gameManager" && c.datamodel.Split(0) != "countIn").ToList()[0].datamodel.Split(0); + if (gameInfo.fxOnly) + { + name = Beatmap.entities.FindAll(c => { + var gameName = c.datamodel.Split(0); + var newGameInfo = GetGameInfo(gameName); + if (newGameInfo == null) + return false; + else + return !newGameInfo.fxOnly; + }).ToList()[0].datamodel.Split(0); + } } return Resources.Load($"Games/{name}"); }