refactor(editor): Complete architecture refactoring

- SceneManager: remove singleton, use dependency injection via EditorContext
- SelectionManager: already interface-based via ISelectionManager
- Panel: now receives IEditorContext for accessing managers
- HierarchyPanel: migrated to use IEditorContext instead of singletons
- Add ISceneManager interface and SceneManagerImpl
- EditorContextImpl: holds all editor subsystems

Architecture now follows dependency injection pattern:
Application -> EditorContext -> SceneManager/SelectionManager
EditorLayer -> Panels (receive context via SetContext)

All Manager singletons removed: EditorSceneManager::Get(), SelectionManager::Get()
This commit is contained in:
2026-03-25 15:51:27 +08:00
parent 56ec2e9b85
commit 008fb98dee
18 changed files with 1491 additions and 181 deletions

View File

@@ -33,6 +33,14 @@ void EditorLayer::onAttach() {
m_consolePanel = std::make_unique<ConsolePanel>();
m_projectPanel = std::make_unique<ProjectPanel>();
m_menuBar->SetContext(m_context.get());
m_hierarchyPanel->SetContext(m_context.get());
m_sceneViewPanel->SetContext(m_context.get());
m_gameViewPanel->SetContext(m_context.get());
m_inspectorPanel->SetContext(m_context.get());
m_consolePanel->SetContext(m_context.get());
m_projectPanel->SetContext(m_context.get());
m_menuBar->OnAttach();
m_hierarchyPanel->OnAttach();
m_sceneViewPanel->OnAttach();