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

Method OnInitialize

Source/Engine/Level/Level.cpp:1365–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1363}
1364
1365SceneResult SceneLoader::OnInitialize(Args& args)
1366{
1367 // Initialize scene objects
1368 PROFILE_CPU_NAMED("Initialize");
1369 ASSERT_LOW_LAYER(IsInMainThread());
1370 SceneObject** objects = SceneObjects->Get();
1371 for (int32 i = 0; i < SceneObjects->Count(); i++)
1372 {
1373 SceneObject* obj = objects[i];
1374 if (obj)
1375 {
1376 obj->Initialize();
1377
1378 // Delete objects without parent
1379 if (i != 0 && obj->GetParent() == nullptr)
1380 {
1381 LOG(Warning, "Scene object {0} {1} has missing parent object after load. Removing it.", obj->GetID(), obj->ToString());
1382 obj->DeleteObject();
1383 }
1384 }
1385 }
1386 PrefabSyncData->InitNewObjects();
1387
1388 NextStage();
1389 return SceneResult::Success;
1390}
1391
1392SceneResult SceneLoader::OnBeginPlay(Args& args)
1393{

Callers

nothing calls this directly

Calls 9

IsInMainThreadFunction · 0.85
GetIDMethod · 0.80
DeleteObjectMethod · 0.80
InitNewObjectsMethod · 0.80
GetMethod · 0.45
CountMethod · 0.45
InitializeMethod · 0.45
GetParentMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected