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

This commit is contained in:
Harald Csaszar 2023-11-22 17:23:54 +01:00
parent a5f7d68d12
commit 549f19383d
7 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.timeline", "name": "com.esotericsoftware.spine.timeline",
"displayName": "Spine Timeline Extensions", "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)", "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", "unity": "2018.3",
"author": { "author": {
"name": "Esoteric Software", "name": "Esoteric Software",