Add bindable to drawable catch hit obejcts

This commit is contained in:
ekrctb
2020-11-27 10:55:33 +09:00
parent 5e36fb322a
commit 23109f5bbc
3 changed files with 68 additions and 11 deletions

View File

@ -36,15 +36,19 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
VisualRepresentation.Value = GetVisualRepresentation(change.NewValue);
}, true);
VisualRepresentation.BindValueChanged(change =>
{
ScaleContainer.Child = new SkinnableDrawable(
new CatchSkinComponent(getComponent(change.NewValue)),
_ => fruitPiece = new FruitPiece
{
VisualRepresentation = { BindTarget = VisualRepresentation },
});
}, true);
VisualRepresentation.BindValueChanged(_ => updatePiece());
HyperDash.BindValueChanged(_ => updatePiece(), true);
}
private void updatePiece()
{
ScaleContainer.Child = new SkinnableDrawable(
new CatchSkinComponent(getComponent(VisualRepresentation.Value)),
_ => fruitPiece = new FruitPiece
{
VisualRepresentation = { BindTarget = VisualRepresentation },
HyperDash = { BindTarget = HyperDash },
});
}
protected override void OnApply()