ActionContext.cs
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace UnityEditor.Timeline.Actions
{
/// <summary>
/// Action context to be used by actions.
/// </summary>
/// <seealso cref="Invoker"/>
/// <seealso cref="TimelineAction"/>
public struct ActionContext
{
IEnumerable<TrackAsset> m_Tracks;
IEnumerable<TimelineClip> m_Clips;
IEnumerable<IMarker> m_Markers;
/// <summary>
/// The Timeline asset that is currently opened in the Timeline window.
/// </summary>
public TimelineAsset timeline;
/// <summary>
/// The PlayableDirector that is used to play the current Timeline asset.
/// </summary>
public PlayableDirector director;
/// <summary>
/// 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).
/// </summary>
public double? invocationTime;
/// <summary>
/// Tracks that will be used by the actions.
/// </summary>
public IEnumerable<TrackAsset> tracks
{
get => m_Tracks ?? Enumerable.Empty<TrackAsset>();
set => m_Tracks = value;
}
/// <summary>
/// Clips that will be used by the actions.
/// </summary>
public IEnumerable<TimelineClip> clips
{
get => m_Clips ?? Enumerable.Empty<TimelineClip>();
set => m_Clips = value;
}
/// <summary>
/// Markers that will be used by the actions.
/// </summary>
public IEnumerable<IMarker> markers
{
get => m_Markers ?? Enumerable.Empty<IMarker>();
set => m_Markers = value;
}
}
}