1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 20:22:55 +08:00

Fix null reference of LegacyFruitPiece

This commit is contained in:
ekrctb 2020-11-30 19:56:12 +09:00
parent 70628235e3
commit 4cd234ea05

View File

@ -19,7 +19,8 @@ namespace osu.Game.Rulesets.Catch.Skinning
{ {
private readonly string lookupName; private readonly string lookupName;
private readonly IBindable<Color4> accentColour = new Bindable<Color4>(); private readonly Bindable<Color4> accentColour = new Bindable<Color4>();
private readonly Bindable<bool> hyperDash = new Bindable<bool>();
private Sprite colouredSprite; private Sprite colouredSprite;
public LegacyFruitPiece(string lookupName) public LegacyFruitPiece(string lookupName)
@ -34,6 +35,7 @@ namespace osu.Game.Rulesets.Catch.Skinning
var drawableCatchObject = (DrawablePalpableCatchHitObject)drawableObject; var drawableCatchObject = (DrawablePalpableCatchHitObject)drawableObject;
accentColour.BindTo(drawableCatchObject.AccentColour); accentColour.BindTo(drawableCatchObject.AccentColour);
hyperDash.BindTo(drawableCatchObject.HyperDash);
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
@ -51,9 +53,9 @@ namespace osu.Game.Rulesets.Catch.Skinning
}, },
}; };
if (drawableCatchObject.HitObject.HyperDash) if (hyperDash.Value)
{ {
var hyperDash = new Sprite var hyperDashOverlay = new Sprite
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -67,7 +69,7 @@ namespace osu.Game.Rulesets.Catch.Skinning
Catcher.DEFAULT_HYPER_DASH_COLOUR, Catcher.DEFAULT_HYPER_DASH_COLOUR,
}; };
AddInternal(hyperDash); AddInternal(hyperDashOverlay);
} }
} }