I am building a sketcher (of sorts) using Unity (its an educational “game”). So, for example, a user could create points and then draw lines between these points (using Vectrocity by the way).
I want to add an UNDO / REDO feature and see that Unity has and editor class for UNDO. Is this an appropriate tool for what I want to do or is this literally only to be used for making a custom editor or something??
If this is appropriate is anyone aware of any good examples of its use?
I would think it’d be as simple as saving the state of the program between user inputs up to about five ago, then loading the states in reverse order as you hit the undo button.
How that would translate into your code for sketching? Don’t know. However, if you have a way to save and load sketches, going from there to storing temporary states wouldn’t be too hard.
Unity’s undo feature can only be used in the editor. To make an undo feature in your game, you have to implement it yourself, such as by using a queue which stores user actions.