Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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. }