Fork Lifter fully functional again + more progress on dynamic event caller

This commit is contained in:
Starpelly
2021-12-22 20:49:16 -05:00
parent a0e2636ecd
commit 575e47e384
8 changed files with 230 additions and 31 deletions

View File

@ -15,8 +15,9 @@ namespace RhythmHeavenMania
private EventCaller eventCaller;
public Beatmap Beatmap;
[HideInInspector] public List<Beatmap.Entity> playerEntities;
public int currentEvent;
public int currentEvent, currentPlayerEvent;
public TextAsset txt;
@ -62,7 +63,7 @@ namespace RhythmHeavenMania
{
if (Conductor.instance.songPositionInBeats >= entities[currentEvent])
{
eventCaller.CallEvent(Beatmap.entities[currentEvent].datamodel, Beatmap.entities[currentEvent].beat);
eventCaller.CallEvent(Beatmap.entities[currentEvent].datamodel);
currentEvent++;
}
@ -79,7 +80,9 @@ namespace RhythmHeavenMania
if (Beatmap.entities.Count > 0)
{
List<float> entities = Beatmap.entities.Select(c => c.beat).ToList();
List<float> entities_p = playerEntities.Select(c => c.beat).ToList();
currentEvent = entities.IndexOf(Mathp.GetClosestInList(entities, Conductor.instance.songPositionInBeats));
currentPlayerEvent = entities_p.IndexOf(Mathp.GetClosestInList(entities_p, Conductor.instance.songPositionInBeats));
}
}