UP-Viagg-io/Viagg-io/Assets/Packages/DefaultPlayables/Video/VideoScriptPlayableTrack.cs

34 lines
1.1 KiB
C#
Raw Normal View History

2024-05-15 13:18:09 +02:00
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
[Serializable]
[TrackClipType(typeof(VideoScriptPlayableAsset))]
[TrackColor(0.008f, 0.698f, 0.655f)]
public class VideoScriptPlayableTrack : TrackAsset
{
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
{
PlayableDirector playableDirector = go.GetComponent<PlayableDirector>();
ScriptPlayable<VideoSchedulerPlayableBehaviour> playable =
ScriptPlayable<VideoSchedulerPlayableBehaviour>.Create(graph, inputCount);
VideoSchedulerPlayableBehaviour videoSchedulerPlayableBehaviour =
playable.GetBehaviour();
if (videoSchedulerPlayableBehaviour != null)
{
videoSchedulerPlayableBehaviour.director = playableDirector;
videoSchedulerPlayableBehaviour.clips = GetClips();
}
return playable;
}
}
}