mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 21:59:09 +08:00
[libgdx] AnimationState, improved triggering complete event.
This commit is contained in:
parent
94d8a3a387
commit
88b009cd1f
@ -483,9 +483,14 @@ public class AnimationState {
|
|||||||
|
|
||||||
// Queue complete if completed a loop iteration or the animation.
|
// Queue complete if completed a loop iteration or the animation.
|
||||||
boolean complete;
|
boolean complete;
|
||||||
if (entry.loop)
|
if (entry.loop) {
|
||||||
complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;
|
if (duration == 0)
|
||||||
else
|
complete = true;
|
||||||
|
else {
|
||||||
|
int cycles = (int)(entry.trackTime / duration);
|
||||||
|
complete = cycles > 0 && cycles > (int)(entry.trackLast / duration);
|
||||||
|
}
|
||||||
|
} else
|
||||||
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
||||||
if (complete) queue.complete(entry);
|
if (complete) queue.complete(entry);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user