Remove Thread.Sleep and tidy up new method

This commit is contained in:
Dean Herbert 2017-10-24 11:40:38 +09:00
parent cc01878f2b
commit e98bfec644

View File

@ -277,17 +277,7 @@ namespace osu.Game
private void loadComponentSingleFile<T>(T d, Action<T> add)
where T : Drawable
{
Schedule(() =>
{
if (asyncLoadStream != null)
asyncLoadStream = asyncLoadStream.ContinueWith(t =>
{
Thread.Sleep(100);
LoadComponentAsync(d, add).Wait();
});
else
asyncLoadStream = LoadComponentAsync(d, add);
});
Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); });
}
public bool OnPressed(GlobalAction action)