[csharp] Fixes completion event firing for 0 duration animations. See #1112.

This commit is contained in:
badlogic 2018-05-16 11:42:19 +02:00
parent 1833f4211a
commit 0ad0fc4de8

View File

@ -366,10 +366,12 @@ namespace Spine {
}
// Queue complete if completed a loop iteration or the animation.
if (entry.loop ? (trackLastWrapped > entry.trackTime % duration)
: (animationTime >= animationEnd && entry.animationLast < animationEnd)) {
queue.Complete(entry);
}
var complete = false;
if (entry.loop)
complete = duration == 0 || (trackLastWrapped > entry.trackTime % duration);
else
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
if (complete) queue.Complete(entry);
// Queue events after complete.
for (; i < n; i++) {