mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[csharp] Port of commit 88b009c: AnimationState, improved triggering complete event.
This commit is contained in:
parent
88b009cd1f
commit
d4242a8257
@ -595,9 +595,14 @@ namespace Spine {
|
|||||||
|
|
||||||
// Queue complete if completed a loop iteration or the animation.
|
// Queue complete if completed a loop iteration or the animation.
|
||||||
bool complete = false;
|
bool complete = false;
|
||||||
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