Merge pull request #15 from jakobwcrowe/megaminerzero

General solution to attempting to Instantiate "fxOnly" games
This commit is contained in:
Braedon 2022-02-03 02:50:16 -05:00 committed by GitHub
commit 9f80676c13

View file

@ -352,9 +352,20 @@ namespace RhythmHeavenMania
public GameObject GetGame(string name) 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<GameObject>($"Games/{name}"); return Resources.Load<GameObject>($"Games/{name}");
} }