mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Add pitch randomisation to HoverSounds on-hover sample playback
This commit is contained in:
parent
d91e17542a
commit
73ab1b2b21
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Framework.Utils;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -49,9 +50,11 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
bool enoughTimePassedSinceLastPlayback = !lastPlaybackTime.Value.HasValue || Time.Current - lastPlaybackTime.Value >= HoverDebounceTime;
|
||||
|
||||
if (enoughTimePassedSinceLastPlayback)
|
||||
if (enoughTimePassedSinceLastPlayback && sampleHover != null)
|
||||
{
|
||||
sampleHover?.Play();
|
||||
sampleHover.Frequency.Value = 0.96 + RNG.NextDouble(0.08);
|
||||
sampleHover.Play();
|
||||
|
||||
lastPlaybackTime.Value = Time.Current;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user