瀏覽代碼

[unity] Updated examples to use trackEntry.SetMixDuration(mixDuration, delay) instead of mixDuration.

Harald Csaszar 1 年之前
父節點
當前提交
549f19383d

+ 1 - 1
spine-unity/Assets/Spine Examples/Other Examples/Animation Tester/SpineAnimationTesterTool.cs

@@ -141,7 +141,7 @@ namespace Spine.Unity.Examples {
 
 						if (trackEntry != null) {
 							if (control.useCustomMixDuration)
-								trackEntry.MixDuration = control.mixDuration;
+								trackEntry.SetMixDuration(control.mixDuration, 0f); // use SetMixDuration(mixDuration, delay) to update delay correctly
 
 							if (useOverrideAttachmentThreshold)
 								trackEntry.MixAttachmentThreshold = attachmentThreshold;

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerView.cs

@@ -125,13 +125,13 @@ namespace Spine.Unity.Examples {
 			// Play the shoot animation on track 1.
 			TrackEntry shootTrack = skeletonAnimation.AnimationState.SetAnimation(1, shoot, false);
 			shootTrack.MixAttachmentThreshold = 1f;
-			shootTrack.MixDuration = 0f;
+			shootTrack.SetMixDuration(0f, 0f);
 			skeletonAnimation.state.AddEmptyAnimation(1, 0.5f, 0.1f);
 
 			// Play the aim animation on track 2 to aim at the mouse target.
 			TrackEntry aimTrack = skeletonAnimation.AnimationState.SetAnimation(2, aim, false);
 			aimTrack.MixAttachmentThreshold = 1f;
-			aimTrack.MixDuration = 0f;
+			aimTrack.SetMixDuration(0f, 0f);
 			skeletonAnimation.state.AddEmptyAnimation(2, 0.5f, 0.1f);
 
 			gunSource.pitch = GetRandomPitch(gunsoundPitchOffset);
@@ -144,7 +144,7 @@ namespace Spine.Unity.Examples {
 			// Play the aim animation on track 2 to aim at the mouse target.
 			TrackEntry aimTrack = skeletonAnimation.AnimationState.SetAnimation(2, aim, true);
 			aimTrack.MixAttachmentThreshold = 1f;
-			aimTrack.MixDuration = 0f;
+			aimTrack.SetMixDuration(0f, 0f); // use SetMixDuration(mixDuration, delay) to update delay correctly
 		}
 
 		public void StopPlayingAim () {

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerViewGraphic.cs

@@ -125,13 +125,13 @@ namespace Spine.Unity.Examples {
 			// Play the shoot animation on track 1.
 			TrackEntry shootTrack = skeletonGraphic.AnimationState.SetAnimation(1, shoot, false);
 			shootTrack.MixAttachmentThreshold = 1f;
-			shootTrack.MixDuration = 0f;
+			shootTrack.SetMixDuration(0f, 0f);
 			skeletonGraphic.AnimationState.AddEmptyAnimation(1, 0.5f, 0.1f);
 
 			// Play the aim animation on track 2 to aim at the mouse target.
 			TrackEntry aimTrack = skeletonGraphic.AnimationState.SetAnimation(2, aim, false);
 			aimTrack.MixAttachmentThreshold = 1f;
-			aimTrack.MixDuration = 0f;
+			aimTrack.SetMixDuration(0f, 0f);
 			skeletonGraphic.AnimationState.AddEmptyAnimation(2, 0.5f, 0.1f);
 
 			gunSource.pitch = GetRandomPitch(gunsoundPitchOffset);
@@ -144,7 +144,7 @@ namespace Spine.Unity.Examples {
 			// Play the aim animation on track 2 to aim at the mouse target.
 			TrackEntry aimTrack = skeletonGraphic.AnimationState.SetAnimation(2, aim, true);
 			aimTrack.MixAttachmentThreshold = 1f;
-			aimTrack.MixDuration = 0f;
+			aimTrack.SetMixDuration(0f, 0f); // use SetMixDuration(mixDuration, delay) to update delay correctly
 		}
 
 		public void StopPlayingAim () {

+ 1 - 1
spine-unity/Assets/Spine Examples/package.json

@@ -2,7 +2,7 @@
   "name": "com.esotericsoftware.spine.spine-unity-examples",
   "displayName": "spine-unity Runtime Examples",
   "description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
-  "version": "4.2.23",
+  "version": "4.2.24",
   "unity": "2018.3",
   "author": {
     "name": "Esoteric Software",

+ 1 - 1
spine-unity/Assets/Spine/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.spine-unity",
 	"displayName": "spine-unity Runtime",
 	"description": "This plugin provides the spine-unity runtime core.",
-	"version": "4.2.32",
+	"version": "4.2.33",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",

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

@@ -230,7 +230,7 @@ namespace Spine.Unity.Playables {
 						trackEntry.Alpha = clipData.alpha;
 
 						if (clipData.customDuration)
-							trackEntry.MixDuration = customMixDuration / rootPlayableSpeed;
+							trackEntry.SetMixDuration(customMixDuration / rootPlayableSpeed, 0f);
 
 						timelineStartedTrackEntry = trackEntry;
 					}

+ 1 - 1
spine-unity/Modules/com.esotericsoftware.spine.timeline/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.timeline",
 	"displayName": "Spine Timeline Extensions",
 	"description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity and spine-csharp runtimes as UPM packages (not as spine-unity unitypackage), version 4.2.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-	"version": "4.2.14",
+	"version": "4.2.15",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",