Browse Source

[unity] Fixed Timeline SkeletonGraphic clip exception when DefaultMixDuration is disabled. Closes #2090. Same bugfix as in commit d796131 on 4.1-beta branch.

Harald Csaszar 3 years ago
parent
commit
6bf587057f

+ 8 - 0
spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateGraphicTrack.cs

@@ -30,6 +30,7 @@
 #if UNITY_EDITOR
 using System.ComponentModel;
 #endif
+using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.Playables;
 using UnityEngine.Timeline;
@@ -45,6 +46,13 @@ namespace Spine.Unity.Playables {
 		public int trackIndex = 0;
 
 		public override Playable CreateTrackMixer (PlayableGraph graph, GameObject go, int inputCount) {
+			IEnumerable<TimelineClip> clips = this.GetClips();
+			foreach (TimelineClip clip in clips) {
+				var animationStateClip = clip.asset as SpineAnimationStateClip;
+				if (animationStateClip != null)
+					animationStateClip.timelineClip = clip;
+			}
+
 			var scriptPlayable = ScriptPlayable<SpineAnimationStateMixerBehaviour>.Create(graph, inputCount);
 			var mixerBehaviour = scriptPlayable.GetBehaviour();
 			mixerBehaviour.trackIndex = this.trackIndex;

+ 1 - 1
spine-unity/Modules/com.esotericsoftware.spine.timeline/package-no-spine-unity-dependency.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 runtime (via the spine-unity unitypackage), version 4.0.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-	"version": "4.0.10",
+	"version": "4.0.11",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",

+ 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.0.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-	"version": "4.0.10",
+	"version": "4.0.11",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",