From d08285b62b6a974b03cb4a271a7b2d4eec162438 Mon Sep 17 00:00:00 2001 From: Atdunbg <979541498@qq.com> Date: Wed, 9 Jul 2025 17:55:57 +0800 Subject: [PATCH] add mouse right click to add multiple entity with some component --- Sandbox/src/Editor/Panels/SceneHierachyPanel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sandbox/src/Editor/Panels/SceneHierachyPanel.cpp b/Sandbox/src/Editor/Panels/SceneHierachyPanel.cpp index 8729879..136e4da 100644 --- a/Sandbox/src/Editor/Panels/SceneHierachyPanel.cpp +++ b/Sandbox/src/Editor/Panels/SceneHierachyPanel.cpp @@ -44,7 +44,14 @@ namespace Hazel if (ImGui::BeginPopupContextWindow(0, ImGuiPopupFlags_MouseButtonRight | ImGuiPopupFlags_NoOpenOverItems)) { if (ImGui::MenuItem("Create Empty Entity")) - m_Context->CreateEntity("Empty Entity"); + { + m_SelectionContext = m_Context->CreateEntity("Empty Entity"); + } + else if (ImGui::MenuItem("Create Camera")) + { + m_SelectionContext = m_Context->CreateEntity("Camera"); + m_SelectionContext.AddComponent(); + } ImGui::EndPopup(); }