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:
parent
e98bfec644
commit
9ec870a821
@ -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); });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user