#include "EditorLayer.h" #include "Core/EditorContext.h" namespace XCEngine { namespace Editor { EditorLayer::EditorLayer() : Layer("Editor") {} void EditorLayer::SetContext(std::shared_ptr context) { m_context = context; } void EditorLayer::onAttach() { if (!m_context) { m_context = std::make_shared(); } m_workspace.Attach(*m_context); } void EditorLayer::onDetach() { if (m_context) { m_workspace.Detach(*m_context); } } void EditorLayer::onUpdate(float dt) { m_workspace.Update(dt); } void EditorLayer::onEvent(void* event) { m_workspace.DispatchEvent(event); } void EditorLayer::onUIRender() { m_workspace.Render(); } } }