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.
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
|
4 years ago
|
#if UNITY_2017_1_OR_NEWER
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.Playables;
|
||
|
|
using UnityEngine.Timeline;
|
||
|
|
|
||
|
|
namespace Pegasus
|
||
|
|
{
|
||
|
|
[TrackColor(0.09f, 0.45f, 0.8f)]
|
||
|
|
#if !UNITY_2019_1_OR_NEWER
|
||
|
|
[TrackMediaType(TimelineAsset.MediaType.Script)]
|
||
|
|
#endif
|
||
|
|
[TrackClipType(typeof(PegasusClip))]
|
||
|
|
//[TrackBindingType(typeof(PegasusManager))]
|
||
|
|
public class PegasusTrack : TrackAsset
|
||
|
|
{
|
||
|
|
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
||
|
|
{
|
||
|
|
// Set the display name of the clip to match the pegasus manager
|
||
|
|
foreach (var c in GetClips())
|
||
|
|
{
|
||
|
|
PegasusClip pegasus = (PegasusClip)c.asset;
|
||
|
|
PegasusManager manager = pegasus.PegasusManager.Resolve(graph.GetResolver());
|
||
|
|
c.displayName = manager == null ? "Pegasus" : manager.name;
|
||
|
|
}
|
||
|
|
|
||
|
|
var mixer = ScriptPlayable<PegasusMixerBehaviour>.Create(graph);
|
||
|
|
mixer.SetInputCount(inputCount);
|
||
|
|
return mixer;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
#endif
|