mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +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.
|
||||
boolean complete;
|
||||
if (entry.loop)
|
||||
complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;
|
||||
else
|
||||
if (entry.loop) {
|
||||
if (duration == 0)
|
||||
complete = true;
|
||||
else {
|
||||
int cycles = (int)(entry.trackTime / duration);
|
||||
complete = cycles > 0 && cycles > (int)(entry.trackLast / duration);
|
||||
}
|
||||
} else
|
||||
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
||||
if (complete) queue.complete(entry);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user