readd Sprite Renderer render and panel edit; in renderer scene, add icon for camera and light; improve a user-friendly EditorCamera, is more like UE Editor Camera; fix woring build m_ProjectionMatrix for SceneCamera::Orthographic

This commit is contained in:
2026-03-08 19:27:00 +08:00
parent 79f56b60a0
commit c1bb8f9fba
15 changed files with 380 additions and 159 deletions

View File

@ -102,6 +102,7 @@ namespace Prism
}
}
// Draw Colliders
if (!m_SelectionContext.empty())
{
auto& selection = m_SelectionContext[0];
@ -492,6 +493,7 @@ namespace Prism
m_ObjectsPanel->OnImGuiRender();
m_SceneHierarchyPanel->OnImGuiRender();
m_EditorCamera.OnImGuiRender();
// Editor Panel ------------------------------------------------------------------------------
ImGui::Begin("Environment");
@ -880,14 +882,17 @@ namespace Prism
m_RuntimeScene->OnEvent(e);
}
EventDispatcher dispatcher(e);
dispatcher.Dispatch<KeyPressedEvent>(PM_BIND_EVENT_FN(EditorLayer::OnKeyPressedEvent));
dispatcher.Dispatch<MouseButtonPressedEvent>(PM_BIND_EVENT_FN(EditorLayer::OnMouseButtonPressedEvent));
if (Input::GetCursorMode() == CursorMode::Normal)
{
EventDispatcher dispatcher(e);
dispatcher.Dispatch<KeyPressedEvent>(PM_BIND_EVENT_FN(EditorLayer::OnKeyPressedEvent));
dispatcher.Dispatch<MouseButtonPressedEvent>(PM_BIND_EVENT_FN(EditorLayer::OnMouseButtonPressedEvent));
}
}
bool EditorLayer::OnKeyPressedEvent(KeyPressedEvent& e)
{
if (m_ViewportPanelHovered)
if (m_ViewportPanelFocused)
{
switch (e.GetKeyCode())
{