From 0fd83df869e77720649b83fea6017582394f9911 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Wed, 22 Nov 2017 22:34:56 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2826650..a411b17 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ ### xNode Thinking of developing a node-based plugin? Then this is for you. You can download it as an archive and unpack to a new unity project, or connect it as git submodule. -With a minimal footprint, xNode is ideal as a base for custom state machines, dialogue systems, decision makers etc. +xNode is super userfriendly, intuitive and will help you reap the benefits of node graphs in no time. +With a minimal footprint, it is ideal as a base for custom state machines, dialogue systems, decision makers etc. -![editor](https://user-images.githubusercontent.com/6402525/31379481-a9c15950-adae-11e7-91c4-387dd020261e.png) +![editor](https://user-images.githubusercontent.com/6402525/33150712-01d60602-cfd5-11e7-83b4-eb008fd9d711.png) ### Key features * Lightweight in runtime From 710692a3267f53098e55d9a411d213f4c1f64d0b Mon Sep 17 00:00:00 2001 From: Thor Kramer Brigsted Date: Thu, 23 Nov 2017 10:06:57 +0100 Subject: [PATCH 2/2] Added virtual NodeEdutor.GetTint() --- Scripts/Editor/NodeEditor.cs | 7 +++++++ Scripts/Editor/NodeEditorGUI.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index 7e450e2..5d4e1eb 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -8,6 +8,7 @@ using XNode; namespace XNodeEditor { /// Base class to derive custom Node editors from. Use this to create your own custom inspectors and editors for your nodes. public class NodeEditor { + /// Fires every whenever a node was modified through the editor public static Action onUpdateNode; public Node target; @@ -45,6 +46,12 @@ namespace XNodeEditor { public virtual int GetWidth() { return 200; } + + public virtual Color GetTint() { + Type type = GetType(); + if (NodeEditorWindow.nodeTint.ContainsKey(type)) return NodeEditorWindow.nodeTint[type]; + else return Color.white; + } } [AttributeUsage(AttributeTargets.Class)] diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index e3da60a..a7227b3 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -204,7 +204,7 @@ namespace XNodeEditor { GUILayout.BeginArea(new Rect(nodePos, new Vector2(nodeEditor.GetWidth(), 4000))); GUIStyle style = NodeEditorResources.styles.nodeBody; - if (nodeTint.ContainsKey(nodeType)) GUI.color = nodeTint[nodeType]; + GUI.color = nodeEditor.GetTint(); GUILayout.BeginVertical(new GUIStyle(style)); GUI.color = guiColor; EditorGUI.BeginChangeCheck();