Quellcode durchsuchen

[unity] Fixed Timeline extension package compile error with latest 3.9-beta updates. Closes #1594.

Harald Csaszar vor 5 Jahren
Ursprung
Commit
73ed75cef6

+ 8 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Utility/SkeletonExtensions.cs

@@ -458,5 +458,13 @@ namespace Spine {
 			return ((int)mode & (1U << ScaleBit)) == 0;
 		}
 		#endregion
+
+		// Note: This extension method is required by SpineAnimationStateMixerBehaviour,
+		// which is part of the timeline extension package. Thus the internal member variable
+		// nextTrackLast is not accessible. We favor providing this extension method
+		// over exposing nextTrackLast as public property, which would rather confuse users.
+		public static void AllowImmediateQueue (this TrackEntry trackEntry) {
+			if (trackEntry.nextTrackLast < 0) trackEntry.nextTrackLast = 0;
+		}
 	}
 }

+ 1 - 1
spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs

@@ -161,7 +161,7 @@ namespace Spine.Unity.Playables {
 					if (!isAnimationTransitionMatch) {
 						dummyAnimationState.ClearTracks();
 						fromTrack = dummyAnimationState.SetAnimation(0, fromAnimation, fromClipLoop);
-						if (fromTrack.nextTrackLast < 0) fromTrack.nextTrackLast = 0; // fromTrack.AllowImmediateQueue
+						fromTrack.AllowImmediateQueue();
 						if (toAnimation != null)
 							toTrack = dummyAnimationState.SetAnimation(0, toAnimation, clipData.loop);
 					}