Added the ability to remove components

This commit is contained in:
WiggleWizard
2024-09-16 00:17:28 +01:00
parent b23d418f23
commit 52776186d3
4 changed files with 125 additions and 91 deletions

View File

@@ -548,7 +548,7 @@ void EditorSelectionPanel::DrawNetScriptPanel(Ref<Nuake::File> file)
ImGui::PopTextWrapPos();
}
void EditorSelectionPanel::DrawComponent(const Nuake::Entity& entity, entt::meta_any& component)
void EditorSelectionPanel::DrawComponent(Nuake::Entity& entity, entt::meta_any& component)
{
ZoneScoped;
@@ -571,7 +571,8 @@ void EditorSelectionPanel::DrawComponent(const Nuake::Entity& entity, entt::meta
if(removed)
{
// entity.RemoveComponent<component>();
auto componentType = component.type();
entity.RemoveComponent(componentType);
ImGui::PopStyleVar();
delete boldFont;
}