1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Fix event not being unbound.

This commit is contained in:
Dean Herbert 2016-10-08 19:12:31 +09:00
parent 556420ee58
commit 5a507838d6

View File

@ -3,12 +3,15 @@
using System;
using System.Collections.Generic;
using osu.Framework.Configuration;
using osu.Game.GameModes.Backgrounds;
namespace osu.Game.GameModes.Play
{
class PlaySongSelect : GameModeWhiteBox
{
private Bindable<PlayMode> playMode;
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
protected override IEnumerable<Type> PossibleChildren => new[] {
@ -22,7 +25,15 @@ namespace osu.Game.GameModes.Play
OsuGame osu = Game as OsuGame;
osu.PlayMode.ValueChanged += PlayMode_ValueChanged;
playMode = osu.PlayMode;
playMode.ValueChanged += PlayMode_ValueChanged;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
playMode.ValueChanged -= PlayMode_ValueChanged;
}
private void PlayMode_ValueChanged(object sender, EventArgs e)