mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-08 18:55:07 +00:00
Merge pull request #15 from jakobwcrowe/megaminerzero
General solution to attempting to Instantiate "fxOnly" games
This commit is contained in:
commit
9f80676c13
1 changed files with 13 additions and 2 deletions
|
@ -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<GameObject>($"Games/{name}");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue