1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:52:55 +08:00

Add comment pertaining to why Schedule() is required

This commit is contained in:
Dean Herbert 2017-10-24 11:50:18 +09:00
parent e98bfec644
commit 9ec870a821

View File

@ -277,6 +277,9 @@ namespace osu.Game
private void loadComponentSingleFile<T>(T d, Action<T> add)
where T : Drawable
{
// schedule is here to ensure that all component loads are done after LoadComplete is run (and thus all dependencies are cached).
// with some better organisation of LoadComplete to do construction and dependency caching in one step, followed by calls to loadComponentSingleFile,
// we could avoid the need for scheduling altogether.
Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); });
}