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:
parent
dc72ac016a
commit
bcfe139024
@ -38,7 +38,7 @@ namespace XNodeEditor {
|
|||||||
if (property == null) throw new NullReferenceException();
|
if (property == null) throw new NullReferenceException();
|
||||||
|
|
||||||
// If property is not a port, display a regular property field
|
// 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 {
|
else {
|
||||||
Rect rect = new Rect();
|
Rect rect = new Rect();
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ namespace XNodeEditor {
|
|||||||
public static Styles _styles = null;
|
public static Styles _styles = null;
|
||||||
public static GUIStyle OutputPort { get { return new GUIStyle(EditorStyles.label) { alignment = TextAnchor.UpperRight }; } }
|
public static GUIStyle OutputPort { get { return new GUIStyle(EditorStyles.label) { alignment = TextAnchor.UpperRight }; } }
|
||||||
public class Styles {
|
public class Styles {
|
||||||
public GUIStyle inputPort, nodeHeader, nodeBody, tooltip, nodeHighlight;
|
public GUIStyle inputPort, nodeHeader, nodeBody, tooltip, nodeHighlight, nodeProperty;
|
||||||
|
|
||||||
public Styles() {
|
public Styles() {
|
||||||
GUIStyle baseStyle = new GUIStyle("Label");
|
GUIStyle baseStyle = new GUIStyle("Label");
|
||||||
@ -27,6 +27,8 @@ namespace XNodeEditor {
|
|||||||
inputPort = new GUIStyle(baseStyle);
|
inputPort = new GUIStyle(baseStyle);
|
||||||
inputPort.alignment = TextAnchor.UpperLeft;
|
inputPort.alignment = TextAnchor.UpperLeft;
|
||||||
|
|
||||||
|
nodeProperty = new GUIStyle(baseStyle);
|
||||||
|
|
||||||
nodeHeader = new GUIStyle();
|
nodeHeader = new GUIStyle();
|
||||||
nodeHeader.alignment = TextAnchor.MiddleCenter;
|
nodeHeader.alignment = TextAnchor.MiddleCenter;
|
||||||
nodeHeader.fontStyle = FontStyle.Bold;
|
nodeHeader.fontStyle = FontStyle.Bold;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user