Remove stored hitobject references from skinnable components

This commit is contained in:
smoogipoo
2020-11-05 14:40:48 +09:00
parent 9a7fcadabc
commit 400fcedf0f
13 changed files with 65 additions and 69 deletions

View File

@ -32,6 +32,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private PlaySliderBody sliderBody => Body.Drawable as PlaySliderBody;
public readonly IBindable<int> PathVersion = new Bindable<int>();
private Container<DrawableSliderHead> headContainer;
private Container<DrawableSliderTail> tailContainer;
private Container<DrawableSliderTick> tickContainer;
@ -51,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
tailContainer = new Container<DrawableSliderTail> { RelativeSizeAxes = Axes.Both },
tickContainer = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
repeatContainer = new Container<DrawableSliderRepeat> { RelativeSizeAxes = Axes.Both },
Ball = new SliderBall(HitObject, this)
Ball = new SliderBall(this)
{
GetInitialHitAction = () => HeadCircle.HitAction,
BypassAutoSizeAxes = Axes.Both,
@ -61,6 +63,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
headContainer = new Container<DrawableSliderHead> { RelativeSizeAxes = Axes.Both },
};
PathVersion.BindTo(HitObject.Path.Version);
PositionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition, true);
StackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition, true);
ScaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue), true);