add mouse right click to add multiple entity with some component
This commit is contained in:
@ -44,7 +44,14 @@ namespace Hazel
|
|||||||
if (ImGui::BeginPopupContextWindow(0, ImGuiPopupFlags_MouseButtonRight | ImGuiPopupFlags_NoOpenOverItems))
|
if (ImGui::BeginPopupContextWindow(0, ImGuiPopupFlags_MouseButtonRight | ImGuiPopupFlags_NoOpenOverItems))
|
||||||
{
|
{
|
||||||
if (ImGui::MenuItem("Create Empty Entity"))
|
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<CameraComponent>();
|
||||||
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user