1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:13:21 +08:00

Simplify tick calculation/playback method

This commit is contained in:
Dean Herbert 2021-06-09 19:31:53 +09:00
parent c8947daee3
commit 7d86dafd4f

View File

@ -238,20 +238,6 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
} }
} }
protected override void Update()
{
base.Update();
if (!isTicking) return;
bool enoughTimePassedSinceLastPlayback = Clock.CurrentTime - lastTickPlaybackTime >= tickPlaybackRate.Value;
if (!enoughTimePassedSinceLastPlayback) return;
Schedule(() => scoreTickSound?.Play());
lastTickPlaybackTime = Clock.CurrentTime;
}
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
@ -349,6 +335,17 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
} }
} }
protected override void Update()
{
base.Update();
if (isTicking && Clock.CurrentTime - lastTickPlaybackTime >= tickPlaybackRate.Value)
{
scoreTickSound?.Play();
lastTickPlaybackTime = Clock.CurrentTime;
}
}
private string applauseSampleName private string applauseSampleName
{ {
get get