Class UndoBlock | Unity Reflect | 1.0.0-preview.11
docs.unity3d.com
    Show / Hide Table of Contents

    Class UndoBlock

    Class that automatically groups a series of object actions together as a single undo-operation And works in both the editor and player (with player support simply turning off undo-operations) Mirrors the normal functions you find in the Undo class and collapses them into one operation when the block is complete Proper usage of this class is: using (var undoBlock = new UndoBlock("Desired Undo Message")) { undoBlock.yourCodeToUndo() }

    Inheritance
    Object
    UndoBlock
    Namespace: Unity.Labs.Utils
    Syntax
    public class UndoBlock : IDisposable

    Constructors

    UndoBlock(String, Boolean)

    Declaration
    public UndoBlock(string undoLabel, bool testMode = false)
    Parameters
    Type Name Description
    String undoLabel
    Boolean testMode

    Methods

    AddComponent<T>(GameObject)

    Declaration
    public T AddComponent<T>(GameObject gameObject)
        where T : Component
    Parameters
    Type Name Description
    GameObject gameObject
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Dispose()

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    RecordObject(Object)

    Declaration
    public void RecordObject(Object objectToUndo)
    Parameters
    Type Name Description
    UnityEngine.Object objectToUndo

    RegisterCreatedObject(Object)

    Declaration
    public void RegisterCreatedObject(Object objectToUndo)
    Parameters
    Type Name Description
    UnityEngine.Object objectToUndo

    SetTransformParent(Transform, Transform)

    Declaration
    public void SetTransformParent(Transform transform, Transform newParent)
    Parameters
    Type Name Description
    Transform transform
    Transform newParent
    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