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

Method OnCollectAssets

Source/Editor/Cooker/GameCooker.cpp:657–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657void GameCookerImpl::OnCollectAssets(HashSet<Guid>& assets)
658{
659 PROFILE_MEM(Editor);
660 if (Internal_OnCollectAssets == nullptr)
661 {
662 auto c = GameCooker::GetStaticClass();
663 if (c)
664 Internal_OnCollectAssets = c->GetMethod("Internal_OnCollectAssets", 0);
665 ASSERT(GameCookerImpl::Internal_OnCollectAssets);
666 }
667
668 MCore::Thread::Attach();
669 MObject* exception = nullptr;
670 auto list = (MArray*)Internal_OnCollectAssets->Invoke(nullptr, nullptr, &exception);
671 if (exception)
672 {
673 MException ex(exception);
674 ex.Log(LogType::Error, TEXT("OnCollectAssets"));
675 }
676
677 if (list)
678 {
679 auto ids = MUtils::ToSpan<Guid>(list);
680 for (int32 i = 0; i < ids.Length(); i++)
681 assets.Add(ids[i]);
682 }
683}
684
685bool GameCookerImpl::Build()
686{

Callers

nothing calls this directly

Calls 5

GetMethodMethod · 0.45
InvokeMethod · 0.45
LogMethod · 0.45
LengthMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected