No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TimeDilationPlayableAsset.cs 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Playables;
  4. using UnityEngine.Timeline;
  5. namespace Timeline.Samples
  6. {
  7. // A clip for the timeline dilation track.
  8. [Serializable]
  9. public class TimeDilationPlayableAsset : PlayableAsset, ITimelineClipAsset
  10. {
  11. // Using a template for the playable behaviour will allow any serializable fields on the behaviour
  12. // to be animated.
  13. [NoFoldOut]
  14. public TimeDilationBehaviour template = new TimeDilationBehaviour();
  15. // Implementation of ITimelineClipAsset, that tells the timeline editor which
  16. // features this clip supports.
  17. public ClipCaps clipCaps
  18. {
  19. get { return ClipCaps.Extrapolation | ClipCaps.Blending; }
  20. }
  21. // Called to creates a runtime instance of the clip.
  22. public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
  23. {
  24. // Note that template is passed as a parameter - this
  25. // creates a clone of the template PlayableBehaviour.
  26. return ScriptPlayable<TimeDilationBehaviour>.Create(graph, template);
  27. }
  28. }
  29. }