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