using System; using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline; [Serializable] public class TransformTweenClip : PlayableAsset, ITimelineClipAsset { public TransformTweenBehaviour template = new TransformTweenBehaviour (); public ExposedReference startLocation; public ExposedReference endLocation; public ClipCaps clipCaps { get { return ClipCaps.Blending; } } public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable.Create (graph, template); TransformTweenBehaviour clone = playable.GetBehaviour (); clone.startLocation = startLocation.Resolve (graph.GetResolver ()); clone.endLocation = endLocation.Resolve (graph.GetResolver ()); return playable; } }