public static ScriptPlayable <AlembicMixerPlayable> Create( PlayableGraph graph, GameObject gameObject, int inputCount, AlembicTrack track) { var playable = ScriptPlayable <AlembicMixerPlayable> .Create(graph, inputCount); playable.GetBehaviour().Initialize(gameObject, track); return(playable); }
void Initialize(GameObject gameObject, AlembicTrack track) { #if UNITY_EDITOR Func <TrackAsset, Func <TimelineClip, bool>, TimelineClip[]> getClips = null; getClips = (track_, compare_) => track_.GetChildTracks() .SelectMany(child => getClips(child, compare_)) .Concat(track_.GetClips().Where(compare_)) .OrderBy(clip => clip.start) .ToArray(); _clips = getClips(track, clip => clip.asset is AlembicShotAsset).ToArray(); _clampedPlayers = new List <ValueTuple <AlembicStreamPlayer, double, int, double> >(); _director = gameObject.GetComponent <PlayableDirector>(); #endif }