MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / createLoadingTask

Method createLoadingTask

Source/Engine/Content/BinaryAsset.cpp:553–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551};
552
553ContentLoadTask* BinaryAsset::createLoadingTask()
554{
555 ContentLoadTask* loadTask = Asset::createLoadingTask();
556
557 // Check if asset need any just to be preloaded
558 auto chunksToPreload = getChunksToPreload();
559 if (chunksToPreload != 0)
560 {
561 // Inject loading chunks task
562 auto preLoadChunksTask = New<LoadAssetDataTask>(this, chunksToPreload);
563 preLoadChunksTask->ContinueWith(loadTask);
564 loadTask = preLoadChunksTask;
565 }
566
567 // Before asset loading we have to initialize storage
568 // TODO: maybe in build game we could do it in place?
569 // This step is only for opening asset files in background and upgrading them
570 // In build game we have only a few packages which are ready to use
571 auto initTask = New<InitAssetTask>(this);
572 initTask->ContinueWith(loadTask);
573 loadTask = initTask;
574
575 return loadTask;
576}
577
578Asset::LoadResult BinaryAsset::loadAsset()
579{

Callers

nothing calls this directly

Calls 2

getChunksToPreloadFunction · 0.85
ContinueWithMethod · 0.80

Tested by

no test coverage detected