添加简单场景ctrl+s保存功能
This commit is contained in:
@ -27,27 +27,30 @@ namespace Hazel
|
||||
|
||||
void SceneHierachyPanel::OnImGuiRender()
|
||||
{
|
||||
ImGui::Begin("Scene Hierachy");
|
||||
|
||||
m_Context->m_Registry.view<entt::entity>().each([&](auto entityID)
|
||||
if (m_Context)
|
||||
{
|
||||
DrawEntityNode({entityID, m_Context.get()});
|
||||
});
|
||||
ImGui::Begin("Scene Hierachy");
|
||||
|
||||
if (ImGui::IsMouseDown(0) && ImGui::IsWindowHovered())
|
||||
{
|
||||
m_SelectionContext = { };
|
||||
m_Context->m_Registry.view<entt::entity>().each([&](auto entityID)
|
||||
{
|
||||
DrawEntityNode({entityID, m_Context.get()});
|
||||
});
|
||||
|
||||
if (ImGui::IsMouseDown(0) && ImGui::IsWindowHovered())
|
||||
{
|
||||
m_SelectionContext = {};
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupContextWindow(0, ImGuiPopupFlags_MouseButtonRight | ImGuiPopupFlags_NoOpenOverItems))
|
||||
{
|
||||
if (ImGui::MenuItem("Create Empty Entity"))
|
||||
m_Context->CreateEntity("Empty Entity");
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupContextWindow(0, ImGuiPopupFlags_MouseButtonRight | ImGuiPopupFlags_NoOpenOverItems))
|
||||
{
|
||||
if (ImGui::MenuItem("Create Empty Entity"))
|
||||
m_Context->CreateEntity("Empty Entity");
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Begin("Properties");
|
||||
if (m_SelectionContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user