diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoMascot.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoMascot.cs index 2c94f5f1cb..e66a045881 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoMascot.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoMascot.cs @@ -4,7 +4,6 @@ using System; using osu.Framework.Allocation; using osu.Framework.Audio.Track; -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; using osu.Game.Beatmaps.ControlPoints; @@ -16,8 +15,7 @@ namespace osu.Game.Rulesets.Taiko.UI { private TaikoMascotTextureAnimation idleDrawable, clearDrawable, kiaiDrawable, failDrawable; private EffectControlPoint lastEffectControlPoint; - - public Bindable PlayfieldState; + private TaikoMascotAnimationState playfieldState; public TaikoMascotAnimationState State { get; private set; } @@ -25,13 +23,6 @@ namespace osu.Game.Rulesets.Taiko.UI { RelativeSizeAxes = Axes.Both; - PlayfieldState = new Bindable(); - PlayfieldState.BindValueChanged(b => - { - if (lastEffectControlPoint != null) - ShowState(GetFinalAnimationState(lastEffectControlPoint, b.NewValue)); - }); - State = startingState; } @@ -60,6 +51,20 @@ namespace osu.Game.Rulesets.Taiko.UI drawable.Show(); } + /// + /// Sets the playfield state used for determining the final state. + /// + /// + /// If you're looking to change the state manually, please look at . + /// + public void SetPlayfieldState(TaikoMascotAnimationState state) + { + playfieldState = state; + + if (lastEffectControlPoint != null) + ShowState(GetFinalAnimationState(lastEffectControlPoint, playfieldState)); + } + private TaikoMascotTextureAnimation getStateDrawable(TaikoMascotAnimationState state) { switch (state) @@ -93,7 +98,7 @@ namespace osu.Game.Rulesets.Taiko.UI { base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); - var state = GetFinalAnimationState(lastEffectControlPoint = effectPoint, PlayfieldState.Value); + var state = GetFinalAnimationState(lastEffectControlPoint = effectPoint, playfieldState); ShowState(state); if (state == TaikoMascotAnimationState.Clear) diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index d94503fa67..41879f173e 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -220,7 +220,7 @@ namespace osu.Game.Rulesets.Taiko.UI if (miss && judgedObject.HitObject is StrongHitObject) miss = result.Judgement.AffectsCombo; - mascot.PlayfieldState.Value = miss ? TaikoMascotAnimationState.Fail : TaikoMascotAnimationState.Idle; + mascot.SetPlayfieldState(miss ? TaikoMascotAnimationState.Fail : TaikoMascotAnimationState.Idle); } }