Brak opisu
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.

ActionContext.cs 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using UnityEngine;
  4. using UnityEngine.Playables;
  5. using UnityEngine.Timeline;
  6. namespace UnityEditor.Timeline.Actions
  7. {
  8. /// <summary>
  9. /// Action context to be used by actions.
  10. /// </summary>
  11. /// <seealso cref="Invoker"/>
  12. /// <seealso cref="TimelineAction"/>
  13. public struct ActionContext
  14. {
  15. IEnumerable<TrackAsset> m_Tracks;
  16. IEnumerable<TimelineClip> m_Clips;
  17. IEnumerable<IMarker> m_Markers;
  18. /// <summary>
  19. /// The Timeline asset that is currently opened in the Timeline window.
  20. /// </summary>
  21. public TimelineAsset timeline;
  22. /// <summary>
  23. /// The PlayableDirector that is used to play the current Timeline asset.
  24. /// </summary>
  25. public PlayableDirector director;
  26. /// <summary>
  27. /// Time based on the position of the cursor on the timeline (in seconds).
  28. /// null if the time is not available (in case of a shortcut for example).
  29. /// </summary>
  30. public double? invocationTime;
  31. /// <summary>
  32. /// Tracks that will be used by the actions.
  33. /// </summary>
  34. public IEnumerable<TrackAsset> tracks
  35. {
  36. get => m_Tracks ?? Enumerable.Empty<TrackAsset>();
  37. set => m_Tracks = value;
  38. }
  39. /// <summary>
  40. /// Clips that will be used by the actions.
  41. /// </summary>
  42. public IEnumerable<TimelineClip> clips
  43. {
  44. get => m_Clips ?? Enumerable.Empty<TimelineClip>();
  45. set => m_Clips = value;
  46. }
  47. /// <summary>
  48. /// Markers that will be used by the actions.
  49. /// </summary>
  50. public IEnumerable<IMarker> markers
  51. {
  52. get => m_Markers ?? Enumerable.Empty<IMarker>();
  53. set => m_Markers = value;
  54. }
  55. }
  56. }