From c6c3cdb3c823a4286493a9572f19311d7bc152d8 Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Sun, 11 Jun 2023 14:52:20 +0200 Subject: [PATCH] offbeats now work --- Assets/Scripts/Games/Fillbots/NtrFillbot.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Games/Fillbots/NtrFillbot.cs b/Assets/Scripts/Games/Fillbots/NtrFillbot.cs index 789ec40ac..ebd144962 100644 --- a/Assets/Scripts/Games/Fillbots/NtrFillbot.cs +++ b/Assets/Scripts/Games/Fillbots/NtrFillbot.cs @@ -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; + } } }