Rescope scheduling and improve comment

This commit is contained in:
Salman Ahmed
2022-03-10 17:25:13 +03:00
parent 2c1589e068
commit 8cbc8b944f

View File

@ -209,14 +209,15 @@ namespace osu.Game.Screens.Menu
// we also handle the exit transition. // we also handle the exit transition.
if (MenuVoice.Value) if (MenuVoice.Value)
{ {
// ensure samples have been updated after resume before playing. if (skinnableSeeya != null)
ScheduleAfterChildren(() =>
{ {
if (skinnableSeeya != null) // resuming a screen (i.e. calling OnResume) happens before the screen itself becomes alive,
skinnableSeeya.Play(); // therefore skinnable samples may not be updated yet with the recently selected skin.
else // schedule after children to ensure skinnable samples have processed skin changes before playing.
seeya.Play(); ScheduleAfterChildren(() => skinnableSeeya.Play());
}); }
else
seeya.Play();
// if playing the outro voice, we have more time to have fun with the background track. // if playing the outro voice, we have more time to have fun with the background track.
// initially fade to almost silent then ramp out over the remaining time. // initially fade to almost silent then ramp out over the remaining time.