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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user