cs381/as6/components/LifetimeComponent.cpp

15 lines
272 B
C++

#include "components/LifetimeComponent.hpp"
#include "Entity.hpp"
void LifetimeComponent::Setup() {}
void LifetimeComponent::Update(float dt) {
remaining -= dt;
if (remaining <= 0.0f) {
entity->QueueFree();
}
}
void LifetimeComponent::Cleanup() {}