1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 08:52:55 +08:00

Fix clear sample potentially playing multiple times simultaneously

This commit is contained in:
Bartłomiej Dach 2025-02-12 13:19:55 +01:00
parent e385848edc
commit d87a775e71
No known key found for this signature in database

View File

@ -8,7 +8,6 @@ using osu.Game.Skinning;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Taiko.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Framework.Audio.Sample;
using osu.Game.Audio;
using osuTK;
using osu.Game.Rulesets.Objects.Drawables;
@ -31,7 +30,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
private Sprite spinnerCircle = null!;
private Sprite approachCircle = null!;
private Sprite clearAnimation = null!;
private ISample? clearSample;
private SkinnableSound clearSample = null!;
private LegacySpriteText remainingHitsText = null!;
private bool samplePlayed;
@ -107,12 +106,12 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
},
},
},
clearSample = new SkinnableSound(new SampleInfo("spinner-osu")),
};
drawableSwell = (DrawableSwell)hitObject;
drawableSwell.UpdateHitProgress += animateSwellProgress;
drawableSwell.ApplyCustomUpdateState += updateStateTransforms;
clearSample = skin.GetSample(new SampleInfo("spinner-osu"));
}
private void animateSwellProgress(int numHits)
@ -173,7 +172,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
{
if (!samplePlayed)
{
clearSample?.Play();
clearSample.Play();
samplePlayed = true;
}