MCPcopy Create free account
hub / github.com/Illation/ETEngine / PostLoadEntity

Method PostLoadEntity

Engine/source/EtFramework/SceneGraph/UnifiedScene.cpp:251–269  ·  view source on GitHub ↗

------------------------------ UnifiedScene::PostLoadEntity Allow components to be post load initialized once all entities and components are added, useful for linking component data together

Source from the content-addressed store, hash-verified

249// Allow components to be post load initialized once all entities and components are added, useful for linking component data together
250//
251void UnifiedScene::PostLoadEntity(EntityDescriptor const& entDesc, T_EntityId const parent)
252{
253 T_EntityId const id = entDesc.GetAssignedId();
254
255 for (I_ComponentDescriptor* const compDesc : entDesc.GetComponents())
256 {
257 if (compDesc->CallScenePostLoad())
258 {
259 void* const rawComp = m_Scene.GetComponentData(id, compDesc->GetType());
260 compDesc->OnScenePostLoadRoot(m_Scene, id, rawComp);
261 }
262 }
263
264 // recurse for children
265 for (EntityDescriptor const& childDesc : entDesc.GetChildren())
266 {
267 PostLoadEntity(childDesc, id);
268 }
269}
270
271
272} // namespace fw

Callers

nothing calls this directly

Calls 6

GetAssignedIdMethod · 0.80
CallScenePostLoadMethod · 0.80
GetComponentDataMethod · 0.80
OnScenePostLoadRootMethod · 0.80
GetChildrenMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected