1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00

Exposed node name

This commit is contained in:
Thor Brigsted 2017-09-22 10:28:44 +02:00
parent 8b7b40933f
commit 9ef6069ea7
3 changed files with 11 additions and 8 deletions

View File

@ -139,7 +139,8 @@ public partial class NodeEditorWindow {
GUIStyle style = (node == selectedNode) ? (GUIStyle)"flow node 0 on" : (GUIStyle)"flow node 0"; GUIStyle style = (node == selectedNode) ? (GUIStyle)"flow node 0 on" : (GUIStyle)"flow node 0";
GUILayout.BeginArea(new Rect(nodePos,new Vector2(200,4000))); 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(); GUILayout.BeginHorizontal();
//Inputs //Inputs

View File

@ -7,6 +7,8 @@ using System;
[Serializable] [Serializable]
public abstract class Node { public abstract class Node {
/// <summary> Name of the node </summary>
public string name = "";
[NonSerialized] public NodeGraph graph; [NonSerialized] public NodeGraph graph;
public string NodeType { get { return nodeType; } } public string NodeType { get { return nodeType; } }
[SerializeField] private string nodeType; [SerializeField] private string nodeType;