Class UndoBlock
Represents a series of object actions as a single undo-operation.
Implements
Inherited Members
Namespace: Unity.XR.CoreUtils
Assembly: solution.dll
Syntax
public class UndoBlock : IDisposable
Remarks
UndoBlock methods work in both Edit mode and Play mode. In Play mode undo-operations are disabled. This class mirrors the normal functions you find in the Undo class and collapses them into one operation when the block is complete.
Examples
Proper usage of this class is:
using (var undoBlock = new UndoBlock("Desired Undo Message"))
{
undoBlock.yourCodeToUndo()
}
Constructors
Name | Description |
---|---|
Undo |
Initialize a new UndoBlock. |
Methods
Name | Description |
---|---|
Add |
Adds a component to the game object and registers an undo operation for this action. |
Dispose() | This code added to correctly implement the disposable pattern. |
Dispose(bool) | Dispose of this object. |
Record |
Records any changes done on the object after the RecordObject function. |
Register |
Register undo operations for a newly created object. |
Set |
Sets the parent transform of an object and records an undo operation. |