mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 18:32:56 +08:00
Merge pull request #26698 from EVAST9919/slider-sample-alloc
Reduce sliding sample allocations in `DrawableSlider`
This commit is contained in:
commit
a3199333bb
@ -239,11 +239,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
if (Tracking.Value && Time.Current >= HitObject.StartTime)
|
||||
{
|
||||
// keep the sliding sample playing at the current tracking position
|
||||
if (!slidingSample.IsPlaying)
|
||||
if (!slidingSample.RequestedPlaying)
|
||||
slidingSample.Play();
|
||||
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball));
|
||||
}
|
||||
else if (slidingSample.IsPlaying)
|
||||
else if (slidingSample.IsPlaying || slidingSample.RequestedPlaying)
|
||||
slidingSample.Stop();
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
if (tracking.NewValue)
|
||||
{
|
||||
if (!spinningSample.IsPlaying)
|
||||
if (!spinningSample.RequestedPlaying)
|
||||
spinningSample.Play();
|
||||
|
||||
spinningSample.VolumeTo(1, 300);
|
||||
|
Loading…
Reference in New Issue
Block a user