Provide runtime undo/redo for editor-style operations (primarily transform changes) using a command stack and Input System shortcuts.
| Class | OC.UI.Undo.RuntimeUndoSystem |
| Prefab object name | UndoManager (child of Interactions) |
| Script | Runtime/Undo/RuntimeUndoSystem.cs |
| Pattern | MonoBehaviourSingleton<RuntimeUndoSystem> |
void Execute();
void Undo();
void Redo();| Type | File | Use |
|---|---|---|
TransformUndoAction |
TransformUndoCommand.cs |
Position/rotation/scale changes |
UndoCommandGroup |
UndoCommandGroup.cs |
Batch multiple commands as one undo step |
Execute(ICommand) pushes onto the undo stack and clears the redo stack. Undo() / Redo() pop stacks and invoke the command.
Transform handles call Capture before drag and Execute on release.
Assign undo and redo actions from OC Input Actions on the UndoManager prefab instance.
| System | Usage |
|---|---|
RuntimeTransformHandle |
Move/rotate handle drags |
TransformComponent |
Inspector vector field edits |
RotationAxis, PositionPlane, etc. |
Handle sub-widgets |
- Include Interactions prefab (contains UndoManager).
- Wire undo/redo input actions.
- Optional: enable
_debugto log command types on undo/redo.