diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs index 9139bce248..b3479c0fae 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -2,9 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; +using osu.Game.Beatmaps.Samples; using osu.Game.Modes.Objects.Drawables; using OpenTK; using OpenTK.Graphics; @@ -48,6 +52,22 @@ namespace osu.Game.Modes.Osu.Objects.Drawables }; } + private AudioSample sample; + + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + string sampleSet = (HitObject.Sample?.Set ?? SampleSet.Normal).ToString().ToLower(); + + sample = audio.Sample.Get($@"Gameplay/{sampleSet}-slidertick"); + } + + protected override void PlaySample() + { + sample?.Play(); + } + + protected override void CheckJudgement(bool userTriggered) { if (Judgement.TimeOffset >= 0) diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 4df49ca01f..4c707c5e62 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -66,7 +66,7 @@ namespace osu.Game.Modes.Objects.Drawables sample = audio.Sample.Get($@"Gameplay/{sampleSet}-hit{hitType}"); } - protected void PlaySample() + protected virtual void PlaySample() { sample?.Play(); }