diff options
Diffstat (limited to 'Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs')
-rw-r--r-- | Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs b/Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs new file mode 100644 index 00000000..426c8a50 --- /dev/null +++ b/Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs @@ -0,0 +1,23 @@ + +namespace UNEB +{ + public abstract class ActionBase + { + + public ActionManager manager; + + /// <summary> + /// Can be used to check if the action is a valid state for furthur execution. + /// For example, we only want to run delete node if a node is selected for deletion. + /// </summary> + /// <returns></returns> + public virtual bool Init() { return true; } + + public abstract void Do(); + + /// <summary> + /// Called when the action is removed from the undo/redo buffers. + /// </summary> + public virtual void OnDestroy() { } + } +}
\ No newline at end of file |