docs.unity3d.com
    Show / Hide Table of Contents

    Class UndoExtensions

    Use this class to record the state of a timeline or its components prior to modification.

    Inheritance
    Object
    UndoExtensions
    Namespace: UnityEditor.Timeline
    Syntax
    public static class UndoExtensions : object
    Remarks

    These methods do not need to be used when adding or deleting tracks, clips or markers. Methods in the UnityEngine.Timeline namespace, such as CreateTrack(Type, TrackAsset, String) or CreateDefaultClip() will apply the appropriate Undo calls when called in Editor.

    Methods

    RegisterClip(TimelineClip, String, Boolean)

    Records any changes done on the clip after being called.

    Declaration
    public static void RegisterClip(TimelineClip clip, string undoTitle, bool includePlayableAsset = true)
    Parameters
    Type Name Description
    TimelineClip clip

    The timeline clip being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    Boolean includePlayableAsset

    Set this value to true to also record changes on the attached playable asset.

    RegisterClips(IEnumerable<TimelineClip>, String, Boolean)

    Records any changes done on the clips after being called.

    Declaration
    public static void RegisterClips(IEnumerable<TimelineClip> clips, string name, bool includePlayableAssets = true)
    Parameters
    Type Name Description
    IEnumerable<TimelineClip> clips

    The timeline clips being modified.

    String name

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    Boolean includePlayableAssets

    Set this value to true to also record changes on the attached playable assets.

    RegisterCompleteTimeline(TimelineAsset, String)

    Records any changes done on the timeline after being called, including any changes to any clips, tracks and markers that occur on the timeline.

    Declaration
    public static void RegisterCompleteTimeline(TimelineAsset asset, string undoTitle)
    Parameters
    Type Name Description
    TimelineAsset asset

    The timeline asset being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterContext(ActionContext, String)

    Records all items contained in an action context. Use this method to record all objects inside the context.

    Declaration
    public static void RegisterContext(ActionContext context, string undoTitle)
    Parameters
    Type Name Description
    ActionContext context

    The action context to record into the Undo system.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterMarker(IMarker, String)

    Records any changes done on the Timeline Marker after being called.

    Declaration
    public static void RegisterMarker(IMarker marker, string undoTitle)
    Parameters
    Type Name Description
    IMarker marker

    The timeline clip being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterMarkers(IEnumerable<IMarker>, String)

    Records any changes done on the Timeline Markers after being called.

    Declaration
    public static void RegisterMarkers(IEnumerable<IMarker> markers, string undoTitle)
    Parameters
    Type Name Description
    IEnumerable<IMarker> markers

    The timeline clip being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterPlayableAsset(PlayableAsset, String)

    Records any changes done on the PlayableAsset after being called.

    Declaration
    public static void RegisterPlayableAsset(PlayableAsset asset, string undoTitle)
    Parameters
    Type Name Description
    PlayableAsset asset

    The timeline track being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterTimeline(TimelineAsset, String)

    Records any changes done on the timeline after being called. This only applies to the timeline asset properties itself, and not any of the tracks or clips on the timeline

    Declaration
    public static void RegisterTimeline(TimelineAsset asset, string undoTitle)
    Parameters
    Type Name Description
    TimelineAsset asset

    The timeline asset being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterTrack(TrackAsset, String)

    Records any changes done on the track after being called, including any changes to clips on the track, but not on markers or PlayableAssets attached to the clips.

    Declaration
    public static void RegisterTrack(TrackAsset asset, string undoTitle)
    Parameters
    Type Name Description
    TrackAsset asset

    The timeline track being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    RegisterTracks(IEnumerable<TrackAsset>, String)

    Records any changes done on the tracks after being called, including any changes to clips on the tracks, but not on markers or PlayableAssets attached to the clips.

    Declaration
    public static void RegisterTracks(IEnumerable<TrackAsset> tracks, string undoTitle)
    Parameters
    Type Name Description
    IEnumerable<TrackAsset> tracks

    The timeline track being modified.

    String undoTitle

    The title of the action to appear in the undo history (i.e. visible in the undo menu).

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023