浏览代码

[lua] Fix for #1064, delay was calculated incorrectly for non-loop previous track entries.

badlogic 7 年之前
父节点
当前提交
b5e5d4aabb
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      spine-lua/AnimationState.lua

+ 6 - 1
spine-lua/AnimationState.lua

@@ -720,7 +720,12 @@ function AnimationState:addAnimation (trackIndex, animation, loop, delay)
     if delay <= 0 then
       local duration = last.animationEnd - last.animationStart
       if duration ~= 0 then
-        delay = delay + duration * (1 + math_floor(last.trackTime / duration)) - data:getMix(last.animation, animation)
+				if last.loop then
+					delay = delay + duration * (1 + math_floor(last.trackTime / duration))
+				else
+					delay = delay + duration
+				end
+        delay = delay - data:getMix(last.animation, animation)
       else
         delay = 0
       end