Move logic to `Update` instead

This commit is contained in:
Dean Herbert 2023-05-03 15:18:37 +09:00
parent 4013cdcfa8
commit 6a59ded1ba
1 changed files with 3 additions and 9 deletions

View File

@ -219,6 +219,9 @@ protected override void Update()
if (Time.Current < releaseTime)
releaseTime = null;
if (Time.Current < HoldStartTime)
endHold();
// Pad the full size container so its contents (i.e. the masking container) reach under the tail.
// This is required for the tail to not be masked away, since it lies outside the bounds of the hold note.
sizingContainer.Padding = new MarginPadding
@ -322,15 +325,6 @@ public void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
if (e.Action != Action.Value)
return;
// do not run any of this logic when rewinding, as it inverts order of presses/releases.
if (Time.Elapsed < 0)
{
// Except for the IsHitting state, as this handles animations that need to be reapplied
// after rewind.
isHitting.Value = false;
return;
}
// Make sure a hold was started
if (HoldStartTime == null)
return;