mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[ts] Port of commit 88b009c: AnimationState, improved triggering complete event.
This commit is contained in:
parent
ccc2b5e644
commit
107f5ca5e6
@ -436,9 +436,14 @@ export class AnimationState {
|
|||||||
|
|
||||||
// Queue complete if completed a loop iteration or the animation.
|
// Queue complete if completed a loop iteration or the animation.
|
||||||
let complete = false;
|
let complete = false;
|
||||||
if (entry.loop)
|
if (entry.loop) {
|
||||||
complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;
|
if (duration == 0)
|
||||||
else
|
complete = true;
|
||||||
|
else {
|
||||||
|
const cycles = Math.floor(entry.trackTime / duration);
|
||||||
|
complete = cycles > 0 && cycles > Math.floor(entry.trackTime / duration);
|
||||||
|
}
|
||||||
|
} else
|
||||||
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
||||||
if (complete) this.queue.complete(entry);
|
if (complete) this.queue.complete(entry);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user