浏览代码

Fixed events on first frame not being fired for looping animations when their duration is 1s.

NathanSweet 9 年之前
父节点
当前提交
b6f7e50ff7
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java

+ 4 - 4
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java

@@ -71,7 +71,7 @@ public class Animation {
 
 		if (loop && duration != 0) {
 			time %= duration;
-			lastTime %= duration;
+			if (lastTime > 0) lastTime %= duration;
 		}
 
 		Array<Timeline> timelines = this.timelines;
@@ -88,7 +88,7 @@ public class Animation {
 
 		if (loop && duration != 0) {
 			time %= duration;
-			lastTime %= duration;
+			if (lastTime > 0) lastTime %= duration;
 		}
 
 		Array<Timeline> timelines = this.timelines;
@@ -516,8 +516,8 @@ public class Animation {
 			if (frames[frameIndex] < lastTime) return;
 
 			String attachmentName = attachmentNames[frameIndex];
-			skeleton.slots.get(slotIndex).setAttachment(
-				attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName));
+			skeleton.slots.get(slotIndex)
+				.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName));
 		}
 	}