浏览代码

[csharp] Fix attachment and draworder threshold TrackEntry settings.

Port of: https://github.com/EsotericSoftware/spine-runtimes/commit/b4c50035b89b989fee5ba70f2965e301f0319bdf
see: https://github.com/EsotericSoftware/spine-runtimes/issues/1204
pharan 6 年之前
父节点
当前提交
2db2f22705
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      spine-csharp/src/AnimationState.cs

+ 12 - 1
spine-csharp/src/AnimationState.cs

@@ -254,6 +254,7 @@ namespace Spine {
 				from.totalAlpha = 0;
 				for (int i = 0; i < timelineCount; i++) {
 					Timeline timeline = timelinesItems[i];
+					MixDirection direction = MixDirection.Out;
 					MixBlend timelineBlend;
 					float alpha;
 					switch (timelineMode[i]) {
@@ -283,7 +284,17 @@ namespace Spine {
 					if (rotateTimeline != null) {
 						ApplyRotateTimeline(rotateTimeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);
 					} else {
-						timeline.Apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend, MixDirection.Out);
+						if (timelineBlend == MixBlend.Setup) {
+							if (timeline is AttachmentTimeline) {
+								if (attachments) direction = MixDirection.In;
+							} else if (timeline is DrawOrderTimeline) {
+								if (drawOrder) {
+									direction = MixDirection.In;
+								}
+							}
+						}
+
+						timeline.Apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend, direction);
 					}
 				}
 			}