text: #include "world_subsystem.h"
  #include "world/scene.h"
  #include "core/object/entity.h"
  
  #include "world/camera.h"
  #include "core/object/transform.h"
  #include "imgui/imgui.h"
  
  namespace luna
  {
  
  WorldSystem::WorldSystem()
  {
  	g_world_sys = this;
  }
  
  bool WorldSystem::OnPreInit()
  {
  	return true;
  }
  
  bool WorldSystem::OnPostInit()
  {
  	return true;
  }
  
  bool WorldSystem::OnInit()
  {
  	m_need_tick = true;
  	manager = new SceneManager();
  	Scene *main_scene = manager->MainScene();
  	return true;
  }
  
  bool WorldSystem::OnShutdown()
  {
  	return true;
  }
  
  void WorldSystem::Tick(float delta_time)
  {
  	Scene *main_scene = manager->MainScene();
  	for (auto &entity : main_scene->m_entities)
  	{
  		if (entity->m_need_tick)
  		{
  			entity->OnTick(delta_time);
  		}
  		for (auto &comp : entity->m_components)
  		{
  			if (comp->m_need_tick)
  			{
  				comp->OnTick(delta_time);
  			}
  		}
  	}
  }
  
  const char *WorldSystem::GetName()
  {
  	return "WorldSubsytem";
  }
  
  void WorldSystem::OnIMGUI()
  {
  }
  
  }