[as3] Ported new fix for 0 timeScale not returning to setup pose. See #1194.

This commit is contained in:
badlogic 2018-10-30 16:31:00 +01:00
parent d71d5a390e
commit 545ac276a0
4 changed files with 3 additions and 10 deletions

View File

@ -90,11 +90,11 @@ package spine.animation {
var nextTime : Number = current.trackLast - next.delay; var nextTime : Number = current.trackLast - next.delay;
if (nextTime >= 0) { if (nextTime >= 0) {
next.delay = 0; next.delay = 0;
next.trackTime = nextTime + delta * next.timeScale; next.trackTime = (nextTime / current.timeScale + delta) * next.timeScale;
current.trackTime += currentDelta; current.trackTime += currentDelta;
setCurrent(i, next, true); setCurrent(i, next, true);
while (next.mixingFrom != null) { while (next.mixingFrom != null) {
next.mixTime += currentDelta; next.mixTime += delta;
next = next.mixingFrom; next = next.mixingFrom;
} }
continue; continue;
@ -145,16 +145,9 @@ package spine.animation {
} }
return finished; return finished;
} }
// If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
if (to.timeScale == 0 && to.mixingTo != null) {
to.timeScale = 1;
to.mixTime = 0;
to.mixDuration = 0;
}
from.trackTime += delta * from.timeScale; from.trackTime += delta * from.timeScale;
to.mixTime += delta * to.timeScale; to.mixTime += delta;
return false; return false;
} }