Parcourir la source

[libgdx] AnimationState, fixed attachment and draw order threshold TrackEntry settings.

closes #1204
NathanSweet il y a 6 ans
Parent
commit
b4c50035b8

+ 11 - 2
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java

@@ -280,6 +280,7 @@ public class AnimationState {
 			from.totalAlpha = 0;
 			from.totalAlpha = 0;
 			for (int i = 0; i < timelineCount; i++) {
 			for (int i = 0; i < timelineCount; i++) {
 				Timeline timeline = (Timeline)timelines[i];
 				Timeline timeline = (Timeline)timelines[i];
+				MixDirection direction = MixDirection.out;
 				MixBlend timelineBlend;
 				MixBlend timelineBlend;
 				float alpha;
 				float alpha;
 				switch (timelineMode[i]) {
 				switch (timelineMode[i]) {
@@ -307,8 +308,16 @@ public class AnimationState {
 				if (timeline instanceof RotateTimeline) {
 				if (timeline instanceof RotateTimeline) {
 					applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1,
 					applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1,
 						firstFrame);
 						firstFrame);
-				} else
-					timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, MixDirection.out);
+				} else {
+					if (timelineBlend == MixBlend.setup) {
+						if (timeline instanceof AttachmentTimeline) {
+							if (attachments) direction = MixDirection.in;
+						} else if (timeline instanceof DrawOrderTimeline) {
+							if (drawOrder) direction = MixDirection.in;
+						}
+					}
+					timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
+				}
 			}
 			}
 		}
 		}