TimeDilationClip.cs 589 B

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