mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 01:06:00 +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.
|
||||
bool complete = false;
|
||||
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