Always remove easing after it is finished
This commit is contained in:
@@ -57,12 +57,12 @@ void updateEasingSystem(ecs_iter_t *it) {
|
||||
|
||||
for (i32 i = 0; i < it->count; i++) {
|
||||
ecs_entity_t entity = it->entities[i];
|
||||
if (!ecs_has_id(ECS, entity, easing[i].compID))
|
||||
continue;
|
||||
if (easing[i].elapsed > easing[i].duration) {
|
||||
ecs_remove(ECS, entity, Easing);
|
||||
continue;
|
||||
}
|
||||
if (!ecs_has_id(ECS, entity, easing[i].compID))
|
||||
continue;
|
||||
easing[i].elapsed += dt;
|
||||
f32 alpha = easing[i].elapsed / easing[i].duration;
|
||||
alpha = BZ_MIN(1.0f, alpha);
|
||||
|
||||
Reference in New Issue
Block a user