浏览代码

[c] Port of commit 9d49999: Changed SequenceTimeline to match AttachmentTimeline behavior.

Mario Zechner 10 月之前
父节点
当前提交
e327e9beb5
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      spine-c/spine-c/src/spine/Animation.c

+ 9 - 3
spine-c/spine-c/src/spine/Animation.c

@@ -1937,6 +1937,15 @@ void _spSequenceTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float
 		}
 	}
 
+	if (self->attachment->type == SP_ATTACHMENT_REGION) sequence = ((spRegionAttachment *) self->attachment)->sequence;
+	if (self->attachment->type == SP_ATTACHMENT_MESH) sequence = ((spMeshAttachment *) self->attachment)->sequence;
+	if (!sequence) return;
+
+	if (direction == SP_MIX_DIRECTION_OUT) {
+		if (blend == SP_MIX_BLEND_SETUP) slot->sequenceIndex = -1;
+		return;
+	}
+
 	frames = self->super.frames->items;
 	if (time < frames[0]) { /* Time is before first frame. */
 		if (blend == SP_MIX_BLEND_SETUP || blend == SP_MIX_BLEND_FIRST) slot->sequenceIndex = -1;
@@ -1948,9 +1957,6 @@ void _spSequenceTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float
 	modeAndIndex = (int) frames[i + MODE];
 	delay = frames[i + DELAY];
 
-	if (self->attachment->type == SP_ATTACHMENT_REGION) sequence = ((spRegionAttachment *) self->attachment)->sequence;
-	if (self->attachment->type == SP_ATTACHMENT_MESH) sequence = ((spMeshAttachment *) self->attachment)->sequence;
-	if (!sequence) return;
 	index = modeAndIndex >> 4;
 	count = sequence->regions->size;
 	mode = modeAndIndex & 0xf;