diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index 8afd227..ddfd626 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -14,8 +14,6 @@ namespace XNodeEditor { [CustomNodeEditor(typeof(XNode.Node))] public class NodeEditor : XNodeEditor.Internal.NodeEditorBase { - private readonly Color DEFAULTCOLOR = new Color32(90, 97, 105, 255); - /// Fires every whenever a node was modified through the editor public static Action onUpdateNode; public readonly static Dictionary portPositions = new Dictionary(); @@ -93,7 +91,7 @@ namespace XNodeEditor { Color color; if (type.TryGetAttributeTint(out color)) return color; // Return default color (grey) - else return DEFAULTCOLOR; + else return NodeEditorPreferences.GetSettings().tintColor; } public virtual GUIStyle GetBodyStyle() { diff --git a/Scripts/Editor/NodeEditorPreferences.cs b/Scripts/Editor/NodeEditorPreferences.cs index 6165072..ace03b9 100644 --- a/Scripts/Editor/NodeEditorPreferences.cs +++ b/Scripts/Editor/NodeEditorPreferences.cs @@ -32,6 +32,7 @@ namespace XNodeEditor { [UnityEngine.Serialization.FormerlySerializedAs("zoomOutLimit")] public float maxZoom = 5f; public float minZoom = 1f; + public Color32 tintColor = new Color32(90, 97, 105, 255); public Color32 highlightColor = new Color32(255, 255, 255, 255); public bool gridSnap = true; public bool autoSave = true; @@ -160,6 +161,7 @@ namespace XNodeEditor { private static void NodeSettingsGUI(string key, Settings settings) { //Label EditorGUILayout.LabelField("Node", EditorStyles.boldLabel); + settings.tintColor = EditorGUILayout.ColorField("Tint", settings.tintColor); settings.highlightColor = EditorGUILayout.ColorField("Selection", settings.highlightColor); settings.noodlePath = (NoodlePath) EditorGUILayout.EnumPopup("Noodle path", (Enum) settings.noodlePath); settings.noodleThickness = EditorGUILayout.FloatField(new GUIContent("Noodle thickness", "Noodle Thickness of the node connections"), settings.noodleThickness);