{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method BeginMacro | App UI | 0.5.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method BeginMacro

    BeginMacro(string)

    Begins composition of a macro command with the given text description.

    An empty command described by the specified text is pushed on the stack. Any subsequent commands pushed on the stack will be appended to the macro command's children until EndMacro() is called.

    While a macro is being composed, the stack is disabled. This means that:
    - Events are not emitted.
    - canRedo and canUndo will always return false.
    - Calling Undo() or Redo() has no effect.
    The stack is re-enabled when the macro is ended.

    Here is an example of how to use macros:

    undoStack.BeginMacro("Insert Red Text");
    undoStack.Push(new InsertText(...));
    undoStack.Push(new SetRedText(...));
    undoStack.EndMacro();
    This code is equivalent to:
    var insertRedText = new UndoCommand("Insert Text");
    new InsertText(..., insertRedText);
    new SetRedText(..., insertRedText);
    undoStack.Push(insertRedText);
    Declaration
    public void BeginMacro(string name)
    Parameters
    Type Name Description
    string name

    The name of the macro command.

    Remarks

    Nested calls to BeginMacro(string) are supported, but every call to BeginMacro(string) must have a corresponding call to EndMacro().

    See Also
    EndMacro()
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)