Make resolved properties protected

This commit is contained in:
ekrctb 2020-12-08 10:30:23 +09:00
parent b2e5658d23
commit 3cbdaf5960
3 changed files with 16 additions and 19 deletions

View File

@ -18,10 +18,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
public readonly Bindable<bool> HyperDash = new Bindable<bool>();
[Resolved(canBeNull: true)]
private DrawableHitObject drawableHitObject { get; set; }
[CanBeNull]
protected DrawablePalpableCatchHitObject DrawableHitObject => (DrawablePalpableCatchHitObject)drawableHitObject;
protected DrawableHitObject DrawableHitObject { get; private set; }
[CanBeNull]
protected BorderPiece BorderPiece;
@ -33,10 +31,12 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
{
base.LoadComplete();
if (DrawableHitObject != null)
var hitObject = (DrawablePalpableCatchHitObject)DrawableHitObject;
if (hitObject != null)
{
AccentColour.BindTo(DrawableHitObject.AccentColour);
HyperDash.BindTo(DrawableHitObject.HyperDash);
AccentColour.BindTo(hitObject.AccentColour);
HyperDash.BindTo(hitObject.HyperDash);
}
HyperDash.BindValueChanged(hyper =>

View File

@ -36,11 +36,10 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
{
base.LoadComplete();
if (DrawableHitObject != null)
{
var fruit = (DrawableFruit)DrawableHitObject;
var fruit = (DrawableFruit)DrawableHitObject;
if (fruit != null)
VisualRepresentation.BindTo(fruit.VisualRepresentation);
}
}
}
}

View File

@ -27,15 +27,11 @@ namespace osu.Game.Rulesets.Catch.Skinning
private readonly Sprite hyperSprite;
[Resolved]
private ISkinSource skin { get; set; }
protected ISkinSource Skin => skin;
protected ISkinSource Skin { get; private set; }
[Resolved(canBeNull: true)]
private DrawableHitObject drawableHitObject { get; set; }
[CanBeNull]
protected DrawablePalpableCatchHitObject DrawableHitObject => (DrawablePalpableCatchHitObject)drawableHitObject;
protected DrawableHitObject DrawableHitObject { get; private set; }
protected LegacyCatchHitObjectPiece()
{
@ -69,10 +65,12 @@ namespace osu.Game.Rulesets.Catch.Skinning
{
base.LoadComplete();
if (DrawableHitObject != null)
var hitObject = (DrawablePalpableCatchHitObject)DrawableHitObject;
if (hitObject != null)
{
AccentColour.BindTo(DrawableHitObject.AccentColour);
HyperDash.BindTo(DrawableHitObject.HyperDash);
AccentColour.BindTo(hitObject.AccentColour);
HyperDash.BindTo(hitObject.HyperDash);
}
hyperSprite.Colour = Skin.GetConfig<CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??