Create ISceneManager interface and fix GetSceneManager return type

- Created ISceneManager interface with Editor需要的 SceneManager 方法
- SceneManager now implements ISceneManager
- IEditorContext::GetSceneManager() now returns ISceneManager& instead of void*
- Removed SceneManager::GetSceneManagerConcrete() method
- Updated HierarchyPanel and InspectorPanel to use ISceneManager interface
This commit is contained in:
2026-03-25 16:39:15 +08:00
parent 48d9e0a7d2
commit 605d086bcc
8 changed files with 193 additions and 194 deletions

View File

@@ -1,6 +1,6 @@
#include "InspectorPanel.h"
#include "Core/EditorContext.h"
#include "Managers/SceneManager.h"
#include "Core/ISceneManager.h"
#include "UI/UI.h"
#include <XCEngine/Debug/Logger.h>
#include <imgui.h>
@@ -38,8 +38,8 @@ void InspectorPanel::Render() {
m_selectedEntityId = m_context->GetSelectionManager().GetSelectedEntity();
if (m_selectedEntityId) {
auto* sceneManager = static_cast<SceneManager*>(m_context->GetSceneManager());
auto* gameObject = sceneManager->GetEntity(m_selectedEntityId);
auto& sceneManager = m_context->GetSceneManager();
auto* gameObject = sceneManager.GetEntity(m_selectedEntityId);
if (gameObject) {
RenderGameObject(gameObject);
} else {