mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 02:22:57 +08:00
Add some randomness to click samples
This commit is contained in:
parent
6115275bc2
commit
396a566a0e
@ -7,6 +7,7 @@ using osu.Framework.Audio;
|
|||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
@ -37,7 +38,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
if (buttons.Contains(e.Button) && Contains(e.ScreenSpaceMousePosition))
|
if (buttons.Contains(e.Button) && Contains(e.ScreenSpaceMousePosition))
|
||||||
sampleClick?.Play();
|
{
|
||||||
|
sampleClick.Frequency.Value = 0.99 + RNG.NextDouble(0.02);
|
||||||
|
sampleClick.Play();
|
||||||
|
}
|
||||||
|
|
||||||
return base.OnClick(e);
|
return base.OnClick(e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user