diff options
Diffstat (limited to 'Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor')
2 files changed, 34 insertions, 0 deletions
diff --git a/Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor/StateGraphEditor.cs b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor/StateGraphEditor.cs new file mode 100644 index 00000000..cbc810a7 --- /dev/null +++ b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor/StateGraphEditor.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using XNode.Examples.StateGraph; +using XNodeEditor; + +namespace XNodeEditor.Examples { + [CustomNodeGraphEditor(typeof(StateGraph))] + public class StateGraphEditor : NodeGraphEditor { + + /// <summary> + /// Overriding GetNodeMenuName lets you control if and how nodes are categorized. + /// In this example we are sorting out all node types that are not in the XNode.Examples namespace. + /// </summary> + public override string GetNodeMenuName(System.Type type) { + if (type.Namespace == "XNode.Examples.StateGraph") { + return base.GetNodeMenuName(type).Replace("X Node/Examples/State Graph/", ""); + } else return null; + } + } +}
\ No newline at end of file diff --git a/Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor/StateGraphEditor.cs.meta b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor/StateGraphEditor.cs.meta new file mode 100644 index 00000000..5a85ea07 --- /dev/null +++ b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/StateMachine/Editor/StateGraphEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: c46ac2790aeee7341998d217311ba8d3 +timeCreated: 1516181207 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |