From 49b25e755b70ec412feaaf0b898d6f7e09d2bea6 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 28 Jun 2022 09:40:37 +0800 Subject: +node example --- .../Assets/UNEB/Editor/Actions/ActionBase.cs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs (limited to 'Other/NodeEditorExamples/Assets/UNEB/Editor/Actions/ActionBase.cs') 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; + + /// + /// 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. + /// + /// + public virtual bool Init() { return true; } + + public abstract void Do(); + + /// + /// Called when the action is removed from the undo/redo buffers. + /// + public virtual void OnDestroy() { } + } +} \ No newline at end of file -- cgit v1.1-26-g67d0