1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 21:03:21 +08:00

Update hit object result when lifetime is end

This commit is contained in:
ekrctb 2019-01-29 15:25:27 +09:00
parent 504e79b968
commit 8955d5de04
2 changed files with 16 additions and 0 deletions

View File

@ -220,6 +220,16 @@ namespace osu.Game.Rulesets.Objects.Drawables
OnNewResult?.Invoke(this, Result);
}
/// <summary>
/// Should be called at least once after lifetime of this hit object is end.
/// </summary>
public void OnLifetimeEnd()
{
foreach (var nested in NestedHitObjects)
nested.OnLifetimeEnd();
UpdateResult(false);
}
/// <summary>
/// Processes this <see cref="DrawableHitObject"/>, checking if a scoring result has occurred.
/// </summary>

View File

@ -31,5 +31,11 @@ namespace osu.Game.Rulesets.UI
int i = yObj.HitObject.StartTime.CompareTo(xObj.HitObject.StartTime);
return i == 0 ? CompareReverseChildID(x, y) : i;
}
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e)
{
if (e.Kind == LifetimeBoundaryKind.End && e.Direction == LifetimeBoundaryCrossingDirection.Forward && e.Child is DrawableHitObject hitObject)
hitObject.OnLifetimeEnd();
}
}
}