|
@@ -30,6 +30,7 @@
|
|
|
#if UNITY_EDITOR
|
|
|
using System.ComponentModel;
|
|
|
#endif
|
|
|
+using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.Playables;
|
|
|
using UnityEngine.Timeline;
|
|
@@ -43,11 +44,26 @@ namespace Spine.Unity.Playables {
|
|
|
#endif
|
|
|
public class SpineAnimationStateGraphicTrack : TrackAsset {
|
|
|
public int trackIndex = 0;
|
|
|
+ [Tooltip("Whenever starting a new animation clip of this track, " +
|
|
|
+ "SkeletonGraphic.UnscaledTime will be set to this value. " +
|
|
|
+ "This allows you to play back Timeline clips either in normal game time " +
|
|
|
+ "or unscaled game time. Note that PlayableDirector.UpdateMethod " +
|
|
|
+ "is ignored and replaced by this property, which allows more fine-granular " +
|
|
|
+ "control per Timeline track.")]
|
|
|
+ public bool unscaledTime = false;
|
|
|
|
|
|
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;
|
|
|
+ mixerBehaviour.unscaledTime = this.unscaledTime;
|
|
|
return scriptPlayable;
|
|
|
}
|
|
|
}
|