Move 'back' sample playback from OnResuming to OnExiting

This commit is contained in:
Jamie Taylor
2022-06-15 13:04:08 +09:00
parent af87722be8
commit 6b744a14b0
3 changed files with 7 additions and 5 deletions

View File

@ -77,7 +77,7 @@ namespace osu.Game.Screens
private Sample sampleExit;
protected virtual bool PlayResumeSound => true;
protected virtual bool PlayExitSound => true;
public virtual float BackgroundParallaxAmount => 1;
@ -173,9 +173,6 @@ namespace osu.Game.Screens
public override void OnResuming(ScreenTransitionEvent e)
{
if (PlayResumeSound)
sampleExit?.Play();
applyArrivingDefaults(true);
// it's feasible to resume to a screen if the target screen never loaded successfully.
@ -215,6 +212,9 @@ namespace osu.Game.Screens
public override bool OnExiting(ScreenExitEvent e)
{
if (PlayExitSound)
sampleExit?.Play();
if (ValidForResume && logo != null)
onExitingLogo();