1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

Styles: Add nodeProperty

This commit is contained in:
Woland 2019-04-12 13:37:36 +02:00
parent dc72ac016a
commit bcfe139024
2 changed files with 4 additions and 2 deletions

View File

@ -38,7 +38,7 @@ namespace XNodeEditor {
if (property == null) throw new NullReferenceException();
// If property is not a port, display a regular property field
if (port == null) EditorGUILayout.PropertyField(property, label, includeChildren, GUILayout.MinWidth(30));
if (port == null) DrawStyledPropertyField(property, label, NodeEditorResources.styles.nodeProperty, true, includeChildren);
else {
Rect rect = new Rect();

View File

@ -18,7 +18,7 @@ namespace XNodeEditor {
public static Styles _styles = null;
public static GUIStyle OutputPort { get { return new GUIStyle(EditorStyles.label) { alignment = TextAnchor.UpperRight }; } }
public class Styles {
public GUIStyle inputPort, nodeHeader, nodeBody, tooltip, nodeHighlight;
public GUIStyle inputPort, nodeHeader, nodeBody, tooltip, nodeHighlight, nodeProperty;
public Styles() {
GUIStyle baseStyle = new GUIStyle("Label");
@ -27,6 +27,8 @@ namespace XNodeEditor {
inputPort = new GUIStyle(baseStyle);
inputPort.alignment = TextAnchor.UpperLeft;
nodeProperty = new GUIStyle(baseStyle);
nodeHeader = new GUIStyle();
nodeHeader.alignment = TextAnchor.MiddleCenter;
nodeHeader.fontStyle = FontStyle.Bold;