Move parallax logic out of BackgroundScreenStack

This commit is contained in:
Dean Herbert
2019-01-31 18:10:21 +09:00
parent bdaff27575
commit b48bb5b792
6 changed files with 29 additions and 33 deletions

View File

@ -60,7 +60,7 @@ namespace osu.Game.Screens
private SampleChannel sampleExit;
protected BackgroundScreen Background => backgroundStack?.Current;
protected BackgroundScreen Background => backgroundStack?.CurrentScreen as BackgroundScreen;
private BackgroundScreen localBackground;
@ -137,7 +137,8 @@ namespace osu.Game.Screens
if (base.OnExiting(next))
return true;
backgroundStack?.Exit(localBackground);
if (localBackground != null && backgroundStack?.CurrentScreen == localBackground)
backgroundStack?.Exit();
Beatmap.UnbindAll();
return false;
@ -157,9 +158,6 @@ namespace osu.Game.Screens
{
if (this.IsCurrentScreen()) LogoArriving(logo, isResuming);
}, true);
if (backgroundStack != null)
backgroundStack.ParallaxAmount = BackgroundParallaxAmount;
}
/// <summary>