Class Undoer
This class helps managing Unity's Undo/Redo system.
Inheritance
System.Object
Undoer
Namespace: InsaneScatterbrain.RetroKit.Editor
Syntax
public class Undoer
Methods
RecordChange<T>(T, String, Boolean)
Make an undo record for this object and it's children (unless specified otherwise).
Declaration
public void RecordChange<T>(T obj, string name, bool recordChildren = true)
where T : Object
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object. |
System.String | name | The name of the undo action. |
System.Boolean | recordChildren | Should an undo record also be register for the children? |
Type Parameters
Name | Description |
---|---|
T | The type of the object. |
RecordComplete<T>(T, String, Boolean)
Make a complete undo record for this object and it's children (unless specified otherwise).
Declaration
public void RecordComplete<T>(T obj, string name, bool recordChildren = true)
where T : Object
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object. |
System.String | name | The name of the undo action. |
System.Boolean | recordChildren | Should an undo record also be register for the children? |
Type Parameters
Name | Description |
---|---|
T | The type of the object. |
Register<T>(Func<T, Object[]>)
Register which properties of an object need to be undone/redone as well, when undo/redo-ing an object of this type.
Declaration
public void Register<T>(Func<T, Object[]> getChildrenFunc)
where T : Object
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, UnityEngine.Object[]> | getChildrenFunc | Function that returns the properties (children) that also need to be undone/redone |
Type Parameters
Name | Description |
---|---|
T |