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++) {
|
for (i32 i = 0; i < it->count; i++) {
|
||||||
ecs_entity_t entity = it->entities[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) {
|
if (easing[i].elapsed > easing[i].duration) {
|
||||||
ecs_remove(ECS, entity, Easing);
|
ecs_remove(ECS, entity, Easing);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!ecs_has_id(ECS, entity, easing[i].compID))
|
||||||
|
continue;
|
||||||
easing[i].elapsed += dt;
|
easing[i].elapsed += dt;
|
||||||
f32 alpha = easing[i].elapsed / easing[i].duration;
|
f32 alpha = easing[i].elapsed / easing[i].duration;
|
||||||
alpha = BZ_MIN(1.0f, alpha);
|
alpha = BZ_MIN(1.0f, alpha);
|
||||||
|
|||||||
Reference in New Issue
Block a user