Add load check to avoid double-loading

This commit is contained in:
Dean Herbert 2019-03-12 12:55:54 +09:00
parent e9ab329e93
commit 5ba8388e54

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
@ -36,6 +36,9 @@ namespace osu.Game.Screens.Backgrounds
beatmap = value;
// load will be completed in async load.
if (LoadState < LoadState.Ready) return;
Schedule(() => { LoadComponentAsync(new BeatmapBackground(beatmap), b => Schedule(() => backgroundLoaded(b))); });
}
}