重构架构:引入EventSystem、EntityID、SelectionManager

- 新增 Event 系统,支持面板间解耦通信
- 用 EntityID 替代裸指针,解决悬空指针问题
- 拆分 SelectionManager 管理选择状态
- SceneManager 使用 EntityID 和 unordered_map 存储
- HierarchyPanel/InspectorPanel 使用事件系统
This commit is contained in:
2026-03-12 17:43:13 +08:00
parent f8fed72cb7
commit c1473d2d39
9 changed files with 322 additions and 116 deletions

View File

@@ -1,17 +1,23 @@
#pragma once
#include "Panel.h"
#include "Core/Event.h"
#include "Core/GameObject.h"
namespace UI {
class InspectorPanel : public Panel {
public:
InspectorPanel();
~InspectorPanel();
void Render() override;
private:
void RenderTransformSection(class TransformComponent* transform);
void RenderMeshRendererSection(class MeshRendererComponent* meshRenderer);
void RenderEntity(Entity* entity);
void RenderComponent(Component* component);
Event<EntityID>::HandlerID m_selectionHandlerId = 0;
};
}