docs.unity3d.com
    Show / Hide Table of Contents

    Class ApplyDefaultUndoAttribute

    Use this attribute on action classes (TimelineAction, ClipAction, MarkerAction and TrackAction) to have the default undo behaviour applied.

    By default, applying this attribute will record all objects passed to the Execute method with the Undo system, using the name of Action it is applied to.

    Simple track Action example (with context menu and shortcut support).
       [ApplyDefaultUndo]
       public class SetNameToTypeAction : TrackAction
       {
           public override ActionValidity Validate(IEnumerable<TrackAsset> items)
           {
               return ActionValidity.Valid;
           }
    
           public override bool Execute(IEnumerable<TrackAsset> items)
           {
               foreach (TrackAsset track in items)
                   track.name = track.GetType().Name;
               return true;
           }
       }
    Inheritance
    Object
    ApplyDefaultUndoAttribute
    Namespace: UnityEditor.Timeline.Actions
    Syntax
    public class ApplyDefaultUndoAttribute : Attribute

    Constructors

    ApplyDefaultUndoAttribute(String)

    Use this attribute on action classes to have the default undo behaviour applied.

    Declaration
    public ApplyDefaultUndoAttribute(string undoTitle = null)
    Parameters
    Type Name Description
    String undoTitle

    The title of the action to appear in the undo history.

    Fields

    UndoTitle

    The title of the action to appear in the undo history. If not specified, the name is taken from the DisplayName attribute, or derived from the name of the class this attribute is applied to.

    Declaration
    public string UndoTitle
    Field Value
    Type Description
    String

    See Also

    TimelineAction
    TrackAction
    ClipAction
    MarkerAction
    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