CurveControlClip.cs 655 B

1234567891011121314151617181920212223
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Playables;
  4. using UnityEngine.Timeline;
  5. [Serializable]
  6. public class CurveControlClip : PlayableAsset, ITimelineClipAsset
  7. {
  8. public CurveControlBehaviour template = new CurveControlBehaviour();
  9. public TimelineClip clipPassthrough = null;
  10. public ClipCaps clipCaps
  11. {
  12. get { return ClipCaps.Blending; }
  13. }
  14. public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
  15. {
  16. template.Clip = clipPassthrough;
  17. var playable = ScriptPlayable<CurveControlBehaviour>.Create(graph, template);
  18. return playable;
  19. }
  20. }