[csharp] Fixed AddAnimation.

Port of a961b41a9c.
See: https://github.com/EsotericSoftware/spine-runtimes/issues/1092
This commit is contained in:
John 2018-03-28 18:37:33 +08:00 committed by GitHub
parent a961b41a9c
commit c956bb4bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -528,13 +528,13 @@ namespace Spine {
float duration = last.animationEnd - last.animationStart; float duration = last.animationEnd - last.animationStart;
if (duration != 0) { if (duration != 0) {
if (last.loop) { if (last.loop) {
delay += duration * (1 + (int)(last.trackTime / duration)); delay += duration * (1 + (int)(last.trackTime / duration)); // Completion of next loop.
} else { } else {
delay += duration; delay += Math.Max(duration, last.trackTime); // After duration, else next update.
} }
delay -= data.GetMix(last.animation, animation); delay -= data.GetMix(last.animation, animation);
} else } else
delay = 0; delay = last.trackTime; // Next update.
} }
} }