Use DI instead

This commit is contained in:
Endrik Tombak 2020-04-05 13:36:52 +03:00
parent 1f6a4fa4b8
commit a3626333be
2 changed files with 6 additions and 4 deletions

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private double animDuration;
private readonly ReverseArrowPiece scaleContainer;
private readonly Drawable scaleContainer;
public DrawableSliderRepeat(SliderRepeat sliderRepeat, DrawableSlider drawableSlider)
: base(sliderRepeat)
@ -80,7 +80,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
case ArmedState.Hit:
this.FadeOut(animDuration, Easing.Out)
.ScaleTo(Scale * 1.5f, animDuration, Easing.Out);
scaleContainer.ShouldFollowBeats = false;
scaleContainer.Transforms.ForEach(t => scaleContainer.RemoveTransform(t));
break;
}

View File

@ -8,12 +8,15 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osu.Game.Skinning;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
public class ReverseArrowPiece : BeatSyncedContainer
{
public bool ShouldFollowBeats = true;
[Resolved]
private DrawableHitObject drawableSlider { get; set; }
public ReverseArrowPiece()
{
@ -41,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
{
if (ShouldFollowBeats)
if (!drawableSlider.IsHit)
Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out);
}
}