diff --git a/Examples/Nodes/Editor/MathNodeEditor.cs b/Examples/Nodes/Editor/MathNodeEditor.cs index d51aadf..38db27b 100644 --- a/Examples/Nodes/Editor/MathNodeEditor.cs +++ b/Examples/Nodes/Editor/MathNodeEditor.cs @@ -1,11 +1,11 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -[CustomNodeEditor(typeof(MathNode))] +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[CustomNodeEditor(typeof(MathNode))] public class AddNodeEditor : NodeEditor { public override void OnNodeGUI() { GUILayout.Label("YEAH CUSTOM"); - } -} + } +} diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index c880c88..3acaffa 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -139,7 +139,8 @@ public partial class NodeEditorWindow { GUIStyle style = (node == selectedNode) ? (GUIStyle)"flow node 0 on" : (GUIStyle)"flow node 0"; GUILayout.BeginArea(new Rect(nodePos,new Vector2(200,4000))); - GUILayout.BeginVertical(node.ToString(), style); + string nodeName = string.IsNullOrEmpty(node.name) ? node.ToString() : node.name; + GUILayout.BeginVertical(nodeName, style); GUILayout.BeginHorizontal(); //Inputs diff --git a/Scripts/Node.cs b/Scripts/Node.cs index 5696e2d..2da1cf0 100644 --- a/Scripts/Node.cs +++ b/Scripts/Node.cs @@ -7,6 +7,8 @@ using System; [Serializable] public abstract class Node { + /// Name of the node + public string name = ""; [NonSerialized] public NodeGraph graph; public string NodeType { get { return nodeType; } } [SerializeField] private string nodeType;