mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 23:08:31 +00:00
Split out LUTriggers into it's own component (#986)
* Split out LUTriggers into it's own component * some cleanup * fix debug log * use emplace and tryParse * slight refactor to make the work on startup rather than at runtime Also TODO's for getting targets via all the possible methods * address feedback
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "SwitchComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eTriggerEventType.h"
|
||||
|
||||
std::vector<SwitchComponent*> SwitchComponent::petSwitches;
|
||||
|
||||
@@ -42,7 +43,7 @@ void SwitchComponent::EntityEnter(Entity* entity) {
|
||||
}
|
||||
m_Active = true;
|
||||
if (!m_Parent) return;
|
||||
m_Parent->TriggerEvent("OnActivated");
|
||||
m_Parent->TriggerEvent(eTriggerEventType::ACTIVATED);
|
||||
|
||||
const auto grpName = m_Parent->GetVarAsString(u"grp_name");
|
||||
|
||||
@@ -78,7 +79,7 @@ void SwitchComponent::Update(float deltaTime) {
|
||||
if (m_Timer <= 0.0f) {
|
||||
m_Active = false;
|
||||
if (!m_Parent) return;
|
||||
m_Parent->TriggerEvent("OnDectivated");
|
||||
m_Parent->TriggerEvent(eTriggerEventType::DEACTIVATED);
|
||||
|
||||
const auto grpName = m_Parent->GetVarAsString(u"grp_name");
|
||||
|
||||
|
Reference in New Issue
Block a user