Recycle slider paths when the parenting slider dies

This commit is contained in:
smoogipoo
2019-07-16 18:19:13 +09:00
parent 1ec8790ad2
commit a9286fee07
4 changed files with 36 additions and 7 deletions

View File

@ -34,8 +34,14 @@ namespace osu.Game.Rulesets.UI
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e)
{
if (e.Kind == LifetimeBoundaryKind.End && e.Direction == LifetimeBoundaryCrossingDirection.Forward && e.Child is DrawableHitObject hitObject)
hitObject.OnLifetimeEnd();
if (!(e.Child is DrawableHitObject hitObject))
return;
if (e.Kind == LifetimeBoundaryKind.End && e.Direction == LifetimeBoundaryCrossingDirection.Forward
|| e.Kind == LifetimeBoundaryKind.Start && e.Direction == LifetimeBoundaryCrossingDirection.Backward)
{
hitObject.OnKilled();
}
}
}
}