VideoScriptPlayableTrack.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Playables;
  5. namespace UnityEngine.Timeline
  6. {
  7. [Serializable]
  8. [TrackClipType(typeof(VideoScriptPlayableAsset))]
  9. [TrackMediaType(TimelineAsset.MediaType.Script)]
  10. [TrackColor(0.008f, 0.698f, 0.655f)]
  11. public class VideoScriptPlayableTrack : TrackAsset
  12. {
  13. public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
  14. {
  15. PlayableDirector playableDirector = go.GetComponent<PlayableDirector>();
  16. ScriptPlayable<VideoSchedulerPlayableBehaviour> playable =
  17. ScriptPlayable<VideoSchedulerPlayableBehaviour>.Create(graph, inputCount);
  18. VideoSchedulerPlayableBehaviour videoSchedulerPlayableBehaviour =
  19. playable.GetBehaviour();
  20. if (videoSchedulerPlayableBehaviour != null)
  21. {
  22. videoSchedulerPlayableBehaviour.director = playableDirector;
  23. videoSchedulerPlayableBehaviour.clips = GetClips();
  24. }
  25. return playable;
  26. }
  27. }
  28. }