Hi,
undo redo will be a huge task indeed, so you need to prepare yourself for a lot of work and experimentation!
basically, on the few successful implementation I have seen around in various projects, I would recommend the following approach:
for each action that supports undo and redo, create one fsm to DO the action and one fsm to UNDO the action, and apply a strict naming convention for fsms naming like
DO - this
UNDO - this
DO - that
UNDO -that
then, you will need a high level controller that will record, for each of these actions, the parameters and have them listed in order of execution, so that you can undo and redo within that ordered list. the action itself will be respsonsible for feeding the hashtable of params, the high level controller must not know anything about what the action does or need, it simply needs to maintained that ordered list of actions so that when you do the Undo redo dance, it simply move up and down the list and call the actions.
Using arraymaker is mandatory here
each action you perform will need to save its associated data in the controller so that when the user undo, you know both the action to undo AND the parameters associated: example:
DO - move
UNDO - move
let's take this action, obviously it takes two parameters at least, the gameobject to move and the vector to actually move it to. so you save in the a hashtable in the controller for that action performed.
"action": "move"
"gameObject": -pointer-
"position":-vector3-
This hashtable proxy will then be saved in your arrayList representing your ordered list of actions. AND the fsm "DO - move" and "UNDO - move" must accept that hasthable reference so that it can retrieve and set its parameters, as only that action knows what to do with this.
When the user wants to undo, you take that last entry added to the list, and perform "UNDO-"+action passing that hashtable reference to it so that it can retrieve what it needs and perform the action.
It may sound difficult to implement, and guess what... it is...
but it's doable. Interesting challenge I say!
Bye,
Jean