From a9c1bd7e7a4c92ed967719c5c87330ecdaea7ceb Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Mon, 31 Oct 2022 17:25:17 +0800 Subject: [PATCH] Added remove component broadcast to removeComponentOfEntity --- SHADE_Engine/src/ECS_Base/Managers/SHComponentManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SHADE_Engine/src/ECS_Base/Managers/SHComponentManager.cpp b/SHADE_Engine/src/ECS_Base/Managers/SHComponentManager.cpp index be78a146..75a86f37 100644 --- a/SHADE_Engine/src/ECS_Base/Managers/SHComponentManager.cpp +++ b/SHADE_Engine/src/ECS_Base/Managers/SHComponentManager.cpp @@ -40,6 +40,12 @@ namespace SHADE { comp->OnDestroy(); } + SHComponentRemovedEvent eventData; + eventData.eid = entityID; + eventData.removedComponentType = i; + + SHEventManager::BroadcastEvent(eventData, SH_COMPONENT_REMOVED_EVENT); + } @@ -53,6 +59,7 @@ namespace SHADE //entityHandle.RemoveHandle(entityID); + }