diff --git a/Engine/include/Components/PhysicsMeshComponent.h b/Engine/include/Components/PhysicsMeshComponent.h index 454cc57..3e0dd5a 100644 --- a/Engine/include/Components/PhysicsMeshComponent.h +++ b/Engine/include/Components/PhysicsMeshComponent.h @@ -90,7 +90,6 @@ namespace Prisma BodyCreationSettings getBodySettings(); void addSoftBody(); - private: std::shared_ptr m_physicsId = nullptr; Body* m_physicsSoftId = nullptr; diff --git a/Engine/src/SceneObjects/Node.cpp b/Engine/src/SceneObjects/Node.cpp index c6fcf1c..78d9ae9 100644 --- a/Engine/src/SceneObjects/Node.cpp +++ b/Engine/src/SceneObjects/Node.cpp @@ -318,5 +318,6 @@ std::map> Prisma::Node::componen void Prisma::Node::removeComponent(const std::string& name) { ComponentsHandler::getInstance().removeComponent(m_components[name]); + m_components[name]->destroy(); m_components.erase(name); } diff --git a/GUI/src/NodeViewer.cpp b/GUI/src/NodeViewer.cpp index a24974b..7fd1c19 100644 --- a/GUI/src/NodeViewer.cpp +++ b/GUI/src/NodeViewer.cpp @@ -103,7 +103,11 @@ void Prisma::NodeViewer::showComponents(Node* nodeData) getInstance().varsDispatcher(field, i); } } - ImGui::Button("Remove Component"); + std::string nameRemove = "Remove Component##" + std::to_string(i); + if (ImGui::Button(nameRemove.c_str())) + { + indexRemove = component.first; + } i++; } if (!indexRemove.empty())