mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 23:12:56 +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;
|
NewResult += OnNewResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnNewDrawableHitObject(DrawableHitObject drawableHitObject)
|
||||||
|
{
|
||||||
|
base.OnNewDrawableHitObject(drawableHitObject);
|
||||||
|
|
||||||
|
var taikoObject = (DrawableTaikoHitObject)drawableHitObject;
|
||||||
|
topLevelHitContainer.Add(taikoObject.CreateProxiedContent());
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -213,8 +221,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
barLinePlayfield.Add(barLine);
|
barLinePlayfield.Add(barLine);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DrawableTaikoHitObject taikoObject:
|
case DrawableTaikoHitObject _:
|
||||||
topLevelHitContainer.Add(taikoObject.CreateProxiedContent());
|
|
||||||
base.Add(h);
|
base.Add(h);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -231,7 +238,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
return barLinePlayfield.Remove(barLine);
|
return barLinePlayfield.Remove(barLine);
|
||||||
|
|
||||||
case DrawableTaikoHitObject _:
|
case DrawableTaikoHitObject _:
|
||||||
// todo: consider tidying of proxied content if required.
|
|
||||||
return base.Remove(h);
|
return base.Remove(h);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user