offbeats now work

This commit is contained in:
Rapandrasmus 2023-06-11 14:52:20 +02:00
parent 7b6c6b319a
commit c6c3cdb3c8

View file

@ -176,7 +176,7 @@ namespace HeavenStudio.Games.Scripts_Fillbots
}
}
if (beepEvent != null && beepEvent.enabled && cond.ReportBeat(ref beepEvent.lastReportedBeat))
if (beepEvent != null && beepEvent.enabled && ReportBeat(ref beepEvent.lastReportedBeat))
{
if (beepEvent.lastReportedBeat < beepEvent.startBeat + beepEvent.length)
{
@ -263,6 +263,17 @@ namespace HeavenStudio.Games.Scripts_Fillbots
{
}
public bool ReportBeat(ref double lastReportedBeat)
{
var cond = Conductor.instance;
bool result = cond.songPositionInBeats >= (lastReportedBeat) + 1f;
if (result)
{
lastReportedBeat += 1f;
}
return result;
}
}
}