Class UndoExtensions
Provides methods that record the state of a timeline, and its components, prior to modification.
Inherited Members
Namespace: UnityEditor .Timeline
Assembly: Unity.Timeline.Editor.dll
Syntax
public static class UndoExtensions
Remarks
The methods in this class are not required when adding or deleting tracks, clips, or markers.
Use methods in the UnityEngine.Timeline namespace, such as Create
Methods
RegisterClip(TimelineClip, string, bool)
Records changes to a clip.
Declaration
public static void RegisterClip(TimelineClip clip, string undoTitle, bool includePlayableAsset = true)
Parameters
Type | Name | Description |
---|---|---|
Timeline |
clip | The timeline clip being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
bool | includePlayableAsset | Set this value to true to record changes to the attached playable asset. |
RegisterClips(IEnumerable<TimelineClip>, string, bool)
Records changes to clips.
Declaration
public static void RegisterClips(IEnumerable<TimelineClip> clips, string name, bool includePlayableAssets = true)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Timeline |
clips | The timeline clips being modified. |
string | name | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
bool | includePlayableAssets | Set this value to true to also record changes to attached playable assets. |
RegisterCompleteTimeline(TimelineAsset, string)
Records all timeline changes including changes to tracks, clips, and markers.
Declaration
public static void RegisterCompleteTimeline(TimelineAsset asset, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
Timeline |
asset | The timeline asset being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterContext(ActionContext, string)
Records changes to all items contained in an action context.
Declaration
public static void RegisterContext(ActionContext context, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
Action |
context | The action context to record into the Undo system. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterMarker(IMarker, string)
Records changes to a timeline marker.
Declaration
public static void RegisterMarker(IMarker marker, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
IMarker | marker | The timeline marker being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterMarkers(IEnumerable<IMarker>, string)
Records changes to timeline markers.
Declaration
public static void RegisterMarkers(IEnumerable<IMarker> markers, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IMarker> | markers | The timeline markers being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterPlayableAsset(PlayableAsset, string)
Records changes to a PlayableAsset.
Declaration
public static void RegisterPlayableAsset(PlayableAsset asset, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
Playable |
asset | The PlayableAsset being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterTimeline(TimelineAsset, string)
Records changes to timeline asset properties. This method does not record changes to tracks or clips.
Declaration
public static void RegisterTimeline(TimelineAsset asset, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
Timeline |
asset | The timeline asset being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterTrack(TrackAsset, string)
Records changes to tracks and clips but not to markers nor PlayableAssets attached to clips.
Declaration
public static void RegisterTrack(TrackAsset asset, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
Track |
asset | The timeline track being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |
RegisterTracks(IEnumerable<TrackAsset>, string)
Records changes to tracks. This includes changes to clips on these tracks, but not changes to markers nor PlayableAssets attached to clips.
Declaration
public static void RegisterTracks(IEnumerable<TrackAsset> tracks, string undoTitle)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Track |
tracks | The timeline track being modified. |
string | undoTitle | The title of the action that appears in the undo history. For example, this title is shown in the Undo menu. |