[csharp] Port of commit 88b009c: AnimationState, improved triggering complete event.

This commit is contained in:
Harald Csaszar 2024-03-20 17:39:37 +01:00
parent 88b009cd1f
commit d4242a8257

View File

@ -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);