Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcs090218/unity_undoredosystem
Undo Redo system implementation in Unity uGUI system
https://github.com/jcs090218/unity_undoredosystem
tools undo-redo unity
Last synced: 3 months ago
JSON representation
Undo Redo system implementation in Unity uGUI system
- Host: GitHub
- URL: https://github.com/jcs090218/unity_undoredosystem
- Owner: jcs090218
- License: mit
- Created: 2018-08-26T17:47:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T07:55:50.000Z (about 1 year ago)
- Last Synced: 2024-11-02T03:32:50.144Z (3 months ago)
- Topics: tools, undo-redo, unity
- Language: C#
- Homepage:
- Size: 433 KB
- Stars: 34
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Unity Engine](https://img.shields.io/badge/unity-2018.2+-black.svg?style=flat&logo=unity)](https://unity3d.com/get-unity/download/archive)# Unity - Undo Redo System
[![Build Status](https://travis-ci.com/jcs090218/Unity_UndoRedoSystem.svg?branch=master)](https://travis-ci.com/jcs090218/Unity_UndoRedoSystem)
Undo Redo system implementation in Unity uGUI system.
## Supported UI
* Input Field
* Dropdown
* Toggle
* Scrollbar
* Slider## API
### Undo Redo System
```cs
JCS_UndoRedoSystem urs = this.GetComponent();// Do undo once from this system if any.
urs.UndoComponent();// Do redo once from this system if any.
urs.RedoComponent();// Stop recording undo/redo action to all the component control
// by this undo/redo system.
urs.StopRecrodingAll();// Start recording undo/redo action to all the component control
// by this undo/redo system.
urs.StartRecrodingAll();// Record initialize data once to all undo/redo component.
urs.RecordPrevData();/* Clear history */
{
// Clear all undo history.
urs.ClearUndoComp();// Clear all redo history.
urs.ClearRedoComp();// Clear all the undo redo history data.
urs.ClearAllUndoRedoHistory();
}/* Check for undo redo action exists? */
{
// Check if there is at least one undo history?
bool undoData = urs.ThereIsUndoHistory();// Check if there is at least one redo history?
bool redoData = urs.ThereIsRedoHistory();// Check if there is at least one undo/redo history?
bool undoRedoData = urs.ThereIsUndoOrRedoHistory();
}
```### Undo Redo Component
```cs
JCS_UndoRedoComponent urc = this.GetComponent();// Do one undo to this component.
urc.Undo();// Dp one redo to this component.
urc.Redo();// Stop recording undo/redo action starting from this moment.
urc.StopRecording();// Start recording undo/redo action starting from this moment.
urc.StartRecording();// Is the current component recording undo/redo action now?
bool isRecording = urc.IsRecording();// If the UI value have changed by script at initialize time
// but the undo/redo component did not get the correct default
// data from the UI call this manually will record down the UI
// starting value.
urc.RecordPrevData();/* Clear history */
{
// Clear all undo history to this component.
urc.ClearAllUndo();
// Clear all redo history to this component.
urc.ClearAllRedo();
// Clear all undo and redo history to this component.
urc.ClearAllUndoRedoHistory();
}
```## 📌 Dependencies
* [JCSUnity](https://github.com/jcs090218/JCSUnity) by [Jen-Chieh Shen](https://github.com/jcs090218)