1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

UI changes

Brighter nodes, fatter wires, padding, prettier enum fields
This commit is contained in:
Thor Brigsted 2017-10-06 19:53:37 +02:00
parent efa1dc9ad5
commit f6d92589dd
4 changed files with 7 additions and 2 deletions

View File

@ -114,7 +114,11 @@ public class NodeEditor {
fieldValue = EditorGUILayout.Toggle(fieldPrettyName, (bool)fieldValue);
}
else if (fieldType.IsEnum) {
fieldValue = EditorGUILayout.EnumPopup(fieldPrettyName, (Enum)fieldValue);
Rect rect = EditorGUILayout.GetControlRect();
rect.width *= 0.5f;
EditorGUI.LabelField(rect, fieldPrettyName);
rect.x += rect.width;
fieldValue = EditorGUI.EnumPopup(rect, (Enum)fieldValue);
}
else if (fieldType == typeof(string)) {

View File

@ -114,7 +114,7 @@ public partial class NodeEditorWindow {
Color prevCol = GUI.color;
Color edgeCol = new Color(0.1f, 0.1f, 0.1f, col.a);
Handles.DrawBezier(startPoint, endPoint, startTangent, endTangent, edgeCol, null, 4);
Handles.DrawBezier(startPoint, endPoint, startTangent, endTangent, col, null, 2);
Handles.DrawBezier(startPoint, endPoint, startTangent, endTangent, col, null, 4);
GUI.color = prevCol;
}

View File

@ -48,6 +48,7 @@ public static class NodeEditorResources {
nodeBody = new GUIStyle();
nodeBody.normal.background = NodeEditorResources.nodeBody;
nodeBody.border = new RectOffset(32, 32, 32, 32);
nodeBody.padding = new RectOffset(10, 10, 2, 2);
}
}