add unique entity name and select it on click
This commit is contained in:
parent
58bf25ff16
commit
e48605b8d3
|
|
@ -22,10 +22,20 @@ namespace NzEditor
|
||||||
std::function<void(Nz::Node*)> drawHierarchy = [&](Nz::Node* c)
|
std::function<void(Nz::Node*)> drawHierarchy = [&](Nz::Node* c)
|
||||||
{
|
{
|
||||||
entt::handle entity = m_nodeToEntity[c];
|
entt::handle entity = m_nodeToEntity[c];
|
||||||
Nz::EditorImgui::Begin(entity, "", "");
|
std::ostringstream oss;
|
||||||
|
oss << "(" << (uint32_t)entity.entity() << ")";
|
||||||
|
if (Nz::EditorImgui::Begin(entity, oss.str(), ""))
|
||||||
|
{
|
||||||
for (auto& child : c->GetChilds())
|
for (auto& child : c->GetChilds())
|
||||||
drawHierarchy(child);
|
drawHierarchy(child);
|
||||||
|
|
||||||
Nz::EditorImgui::End(entity);
|
Nz::EditorImgui::End(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::IsItemClicked())
|
||||||
|
{
|
||||||
|
GetApplication()->OnEntitySelected(entity);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto& node : m_rootNodes)
|
for (auto& node : m_rootNodes)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue