------------------------------ UnifiedScene::PostLoadEntity Allow components to be post load initialized once all entities and components are added, useful for linking component data together
| 249 | // Allow components to be post load initialized once all entities and components are added, useful for linking component data together |
| 250 | // |
| 251 | void 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 |
nothing calls this directly
no test coverage detected