diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 5f07df5088..ade2c2d070 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -82,6 +82,12 @@ namespace osu.Game.Rulesets.UI /// The DrawableHitObject to add. public virtual void Add(DrawableHitObject h) => HitObjects.Add(h); + /// + /// Remove a DrawableHitObject from this Playfield. + /// + /// The DrawableHitObject to remove. + public virtual void Remove(DrawableHitObject h) => HitObjects.Remove(h); + /// /// Triggered when an object's Judgement is updated. /// diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 1a88c74ebc..f1eef6ea31 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -204,6 +204,13 @@ namespace osu.Game.Rulesets.UI queuedHitObjects.Enqueue(hitObject); } + public override bool Remove(DrawableHitObject hitObject) + { + foreach (var c in InternalChildren.OfType()) + c.Remove(hitObject); + return true; + } + protected override void Update() { base.Update();