You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB
C#

1 year ago
using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace Timeline.Samples
{
// A clip for the timeline dilation track.
[Serializable]
public class TimeDilationPlayableAsset : PlayableAsset, ITimelineClipAsset
{
// Using a template for the playable behaviour will allow any serializable fields on the behaviour
// to be animated.
[NoFoldOut]
public TimeDilationBehaviour template = new TimeDilationBehaviour();
// Implementation of ITimelineClipAsset, that tells the timeline editor which
// features this clip supports.
public ClipCaps clipCaps
{
get { return ClipCaps.Extrapolation | ClipCaps.Blending; }
}
// Called to creates a runtime instance of the clip.
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
// Note that template is passed as a parameter - this
// creates a clone of the template PlayableBehaviour.
return ScriptPlayable<TimeDilationBehaviour>.Create(graph, template);
}
}
}