using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline; namespace UnityEditor.Timeline.Actions { /// /// Action context to be used by actions. /// /// /// public struct ActionContext { IEnumerable m_Tracks; IEnumerable m_Clips; IEnumerable m_Markers; /// /// The Timeline asset that is currently opened in the Timeline window. /// public TimelineAsset timeline; /// /// The PlayableDirector that is used to play the current Timeline asset. /// public PlayableDirector director; /// /// Time based on the position of the cursor on the timeline (in seconds). /// null if the time is not available (in case of a shortcut for example). /// public double? invocationTime; /// /// Tracks that will be used by the actions. /// public IEnumerable tracks { get => m_Tracks ?? Enumerable.Empty(); set => m_Tracks = value; } /// /// Clips that will be used by the actions. /// public IEnumerable clips { get => m_Clips ?? Enumerable.Empty(); set => m_Clips = value; } /// /// Markers that will be used by the actions. /// public IEnumerable markers { get => m_Markers ?? Enumerable.Empty(); set => m_Markers = value; } } }