2
3
4
5
9#include "Render/FrameInfo.h"
10#include "World/World/World.h"
11#include "World/Entity.h"
28 if (ImGui::BeginChild(
"Entity Attachments", ImVec2(0, std::min(m_Entities.size() + 0.2f, 10.0f) * ImGuiH::GetLineItemSize().x), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar))
30 for (
auto& item : m_Entities)
33 ss <<
"Attchments [" << item <<
"]";
35 ImGuiH::DrawPropertyItem(ss.str().c_str(), 0,
nullptr, [&]() {
36 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - ImGuiH::GetLineItemSize().x);
38 ImGui::InputTextWithHint(
"##", std::to_string(item).c_str(), buffer,
sizeof(buffer));
39 ImGui::PopItemWidth();
41 ImGuiH::DrawResetIcon(
false);
53 m_Entities.insert(entity);
55 Entity e((entt::entity)entity, FrameInfo::Get().m_World.get());
63 m_Entities.erase(entity);
64 Entity e((entt::entity)entity, FrameInfo::Get().m_World.get());
#define SPICES_PROFILE_ZONE
void AddEntity(uint32_t entity)
Add an child entity to this Component.
virtual void OnDeSerialize() override
This interface defines how to deserialize.
void RemoveEntity(uint32_t entity)
Remove an child entity from this Component.
virtual void OnSerialize() override
This interface defines how to serialize.
virtual void DrawThis() override
This interface defines how to draw this component to property panel.
EntityComponent Class. This class defines the specific behaves of EntityComponent.
void AddToRoot()
Add a entity to this world root.
void RemoveFromRoot()
Remove a entity from this world root.
Entity Class. This class defines the specific behaves of Entity.