Got rid of all hard-coded ForkLifter code from GameManager.

This commit is contained in:
Starpelly
2021-12-20 23:38:59 -05:00
parent 6040f859a9
commit 1bdf6c68e8
12 changed files with 325 additions and 108 deletions

View File

@ -12,6 +12,8 @@ namespace RhythmHeavenMania.Games.ForkLifter
GameManager GameManager;
public List<GameManager.Event> allPlayerActions = new List<GameManager.Event>();
[Header("Objects")]
public Animator handAnim;
public GameObject flickedObject;
@ -28,6 +30,28 @@ namespace RhythmHeavenMania.Games.ForkLifter
private void Start()
{
GameManager = GameManager.instance;
allPlayerActions = GameManager.Events.FindAll(c => c.eventName != "gulp" && c.eventName != "sigh" && c.eventName != "prepare" && c.eventName != "end");
/*List<Event> temp = new List<Event>();
for (int i = 0; i < allPlayerActions.Count; i++)
{
if (i - 1 > 0)
{
if (Mathp.IsWithin(allPlayerActions[i - 1].spawnTime, allPlayerActions[i].spawnTime - 1f, allPlayerActions[i].spawnTime))
{
// do nothing lul
continue;
}
}
Event e = (Event)allPlayerActions[i].Clone();
e.spawnTime = allPlayerActions[i].spawnTime - 1;
e.eventName = "prepare";
temp.Add(e);
}
string s = JsonConvert.SerializeObject(temp);
print(s);*/
}
public void Flick(float beat, int type)

View File

@ -26,7 +26,7 @@ namespace RhythmHeavenMania.Games.ForkLifter
{
allPlayerActions = GameManager.instance.Events.FindAll(c => c.eventName != "gulp" && c.eventName != "sigh" && c.eventName != "prepare");
if (GameManager.instance.currentEventPlayer < allPlayerActions.Count)
/*if (GameManager.instance.currentEventPlayer < allPlayerActions.Count)
{
switch (allPlayerActions[GameManager.instance.currentEventPlayer].eventName)
{
@ -51,7 +51,7 @@ namespace RhythmHeavenMania.Games.ForkLifter
else
{
ForkLifter.instance.peaPreview.sprite = null;
}
}*/
}
public void Prepare()