summaryrefslogtreecommitdiff
path: root/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-06-28 09:40:37 +0800
committerchai <chaifix@163.com>2022-06-28 09:40:37 +0800
commit49b25e755b70ec412feaaf0b898d6f7e09d2bea6 (patch)
tree3c5f4260f30d1c2d7196db93153700d7ddec3157 /Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor
parentc92269331692feca2c276649f6c4ee8911f1f859 (diff)
+node example
Diffstat (limited to 'Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor')
-rw-r--r--Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs20
-rw-r--r--Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs.meta13
2 files changed, 33 insertions, 0 deletions
diff --git a/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs
new file mode 100644
index 00000000..7a580bfe
--- /dev/null
+++ b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs
@@ -0,0 +1,20 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using XNode.Examples;
+
+namespace XNodeEditor.Examples {
+ [CustomNodeGraphEditor(typeof(MathGraph))]
+ public class MathGraphEditor : 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.MathNodes") {
+ return base.GetNodeMenuName(type).Replace("X Node/Examples/Math Nodes/", "");
+ } else return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs.meta b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs.meta
new file mode 100644
index 00000000..89bd3df7
--- /dev/null
+++ b/Other/NodeEditorExamples/Assets/xNode-examples/Examples/MathGraph/Editor/MathGraphEditor.cs.meta
@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: 3f6ed0407f1f4ad45bf697d7798ddf0d
+timeCreated: 1516180270
+licenseType: Free
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: