World initialization refactored to register system components and resources BEFORE initializing them all
because apparently we create entities in system initialization functions now and need all components to be registered and available.
This commit is contained in:
@@ -154,12 +154,14 @@ void dd::World::Initialize()
|
||||
{
|
||||
RegisterSystems();
|
||||
AddSystems();
|
||||
for (auto pair : m_Systems)
|
||||
{
|
||||
auto system = pair.second;
|
||||
system->RegisterComponents(&ComponentFactory);
|
||||
system->RegisterResourceTypes(ResourceManager);
|
||||
system->Initialize();
|
||||
for (auto pair : m_Systems) {
|
||||
pair.second->RegisterComponents(&ComponentFactory);
|
||||
}
|
||||
for (auto pair : m_Systems) {
|
||||
pair.second->RegisterResourceTypes(ResourceManager);
|
||||
}
|
||||
for (auto pair : m_Systems) {
|
||||
pair.second->Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user