Can pick places on timeline and gamemanager bugs fixed

This commit is contained in:
Starpelly
2022-01-07 18:51:08 -05:00
parent afa2d6d482
commit 0208e6c490
8 changed files with 1706 additions and 1413 deletions

View File

@ -93,18 +93,18 @@ namespace RhythmHeavenMania
if (!Conductor.instance.isPlaying)
return;
if (Input.GetKeyDown(KeyCode.A))
/*if (Input.GetKeyDown(KeyCode.A))
{
Conductor.instance.SetTime(Conductor.instance.songPositionInBeats + 3);
Conductor.instance.SetBeat(Conductor.instance.songPositionInBeats + 3);
GetGame(currentGame).holder.GetComponent<Minigame>().OnTimeChange();
}
else if (Input.GetKeyDown(KeyCode.S))
{
Conductor.instance.SetTime(Conductor.instance.songPositionInBeats - 3);
Conductor.instance.SetBeat(Conductor.instance.songPositionInBeats - 3);
GetGame(currentGame).holder.GetComponent<Minigame>().OnTimeChange();
}
}*/
List<float> entities = Beatmap.entities.Select(c => c.beat).ToList();
@ -152,14 +152,23 @@ namespace RhythmHeavenMania
List<float> entities_p = playerEntities.Select(c => c.beat).ToList();
currentPlayerEvent = entities_p.IndexOf(Mathp.GetClosestInList(entities_p, beat));
}
currentEvent = entities.IndexOf(Mathp.GetClosestInList(entities, beat));
print(currentEvent);
string newGame = Beatmap.entities[currentEvent].datamodel.Split('/')[0];
if (newGame != currentGame)
if (Beatmap.entities[currentEvent].datamodel.Split('/')[1] != "switchGame")
{
SwitchGame(newGame);
if (newGame == "gameManager")
{
// holy shit
newGame = Beatmap.entities[entities.IndexOf(Mathp.GetClosestInList(Beatmap.entities.FindAll(c => c.datamodel != "gameManager" && c.beat < Conductor.instance.songPositionInBeats).ToList().Select(c => c.beat).ToList(), beat))].datamodel.Split('/')[0];
}
if (newGame != currentGame)
{
SwitchGame(newGame);
}
}
}
}
@ -191,12 +200,15 @@ namespace RhythmHeavenMania
{
for (int i = 0; i < preloadedGames.Count; i++)
{
if (preloadedGames[i].gameObject.name == game)
if (preloadedGames[i].gameObject != null)
{
preloadedGames[i].SetActive(true);
currentGameO = preloadedGames[i];
preloadedGames.Remove(preloadedGames[i]);
instantiate = false;
if (preloadedGames[i].gameObject.name == game)
{
preloadedGames[i].SetActive(true);
currentGameO = preloadedGames[i];
preloadedGames.Remove(preloadedGames[i]);
instantiate = false;
}
}
}
}