mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 20:22:55 +08:00
Accept proxied content via OnNewDrawableHitObject
In the non-pooled case, `OnNewDrawableHitObject()` will be called automatically on each new DHO via `Playfield.Add(DrawableHitObject)`. In the pooled case, it will be called via `Playfield`'s implementation of `GetPooledDrawableRepresentation(HitObject, DrawableHitObject)`.
This commit is contained in:
parent
62da4eff37
commit
5d575d2a9b
@ -155,6 +155,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
NewResult += OnNewResult;
|
||||
}
|
||||
|
||||
protected override void OnNewDrawableHitObject(DrawableHitObject drawableHitObject)
|
||||
{
|
||||
base.OnNewDrawableHitObject(drawableHitObject);
|
||||
|
||||
var taikoObject = (DrawableTaikoHitObject)drawableHitObject;
|
||||
topLevelHitContainer.Add(taikoObject.CreateProxiedContent());
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
@ -213,8 +221,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
barLinePlayfield.Add(barLine);
|
||||
break;
|
||||
|
||||
case DrawableTaikoHitObject taikoObject:
|
||||
topLevelHitContainer.Add(taikoObject.CreateProxiedContent());
|
||||
case DrawableTaikoHitObject _:
|
||||
base.Add(h);
|
||||
break;
|
||||
|
||||
@ -231,7 +238,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
return barLinePlayfield.Remove(barLine);
|
||||
|
||||
case DrawableTaikoHitObject _:
|
||||
// todo: consider tidying of proxied content if required.
|
||||
return base.Remove(h);
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user