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

Update the nested hitobject logic inline with new implementation

This commit is contained in:
Salman Ahmed 2019-12-12 15:15:16 +03:00
parent 06352a95be
commit 10e1e512fd

View File

@ -15,6 +15,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Ranking;
@ -131,16 +132,37 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Alpha = 0,
}
};
}
foreach (var tick in Spinner.NestedHitObjects.OfType<SpinnerTick>())
protected override void AddNestedHitObject(DrawableHitObject hitObject)
{
base.AddNestedHitObject(hitObject);
switch (hitObject)
{
var drawableTick = new DrawableSpinnerTick(tick);
ticks.Add(drawableTick);
AddNestedHitObject(drawableTick);
case DrawableSpinnerTick tick:
ticks.Add(tick);
break;
}
}
protected override void ClearNestedHitObjects()
{
base.ClearNestedHitObjects();
ticks.Clear();
}
protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject)
{
switch (hitObject)
{
case SpinnerTick tick:
return new DrawableSpinnerTick(tick);
}
return base.CreateNestedHitObject(hitObject);
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{