mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Added simple styling
This commit is contained in:
parent
247377793c
commit
e05327fc0c
@ -25,5 +25,17 @@ namespace XNodeEditor.Examples.LogicToy {
|
|||||||
GUI.DrawTexture(dotRect, NodeEditorResources.dot);
|
GUI.DrawTexture(dotRect, NodeEditorResources.dot);
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnBodyGUI() {
|
||||||
|
NodePort input = target.GetPort("input");
|
||||||
|
NodePort output = target.GetPort("output");
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
if (input != null) NodeEditorGUILayout.PortField(GUIContent.none, input, GUILayout.MinWidth(0));
|
||||||
|
if (output != null) NodeEditorGUILayout.PortField(GUIContent.none, output, GUILayout.MinWidth(0));
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
EditorGUIUtility.labelWidth = 60;
|
||||||
|
base.OnBodyGUI();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -19,6 +19,7 @@ MonoBehaviour:
|
|||||||
- {fileID: 114194736576219100}
|
- {fileID: 114194736576219100}
|
||||||
- {fileID: 114558631167130670}
|
- {fileID: 114558631167130670}
|
||||||
- {fileID: 114481634605117190}
|
- {fileID: 114481634605117190}
|
||||||
|
- {fileID: 114463302483022418}
|
||||||
--- !u!114 &114046633862954194
|
--- !u!114 &114046633862954194
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -48,7 +49,7 @@ MonoBehaviour:
|
|||||||
_connectionType: 0
|
_connectionType: 0
|
||||||
_typeConstraint: 0
|
_typeConstraint: 0
|
||||||
_dynamic: 0
|
_dynamic: 0
|
||||||
interval: 2
|
interval: 1
|
||||||
output: 0
|
output: 0
|
||||||
--- !u!114 &114194736576219100
|
--- !u!114 &114194736576219100
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -96,6 +97,47 @@ MonoBehaviour:
|
|||||||
_typeConstraint: 0
|
_typeConstraint: 0
|
||||||
_dynamic: 0
|
_dynamic: 0
|
||||||
input: 0
|
input: 0
|
||||||
|
output: 1
|
||||||
|
--- !u!114 &114463302483022418
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: c4bb0f0e96df60a4690ca03082a93b44, type: 3}
|
||||||
|
m_Name: Not
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
graph: {fileID: 11400000}
|
||||||
|
position: {x: 88, y: -248}
|
||||||
|
ports:
|
||||||
|
keys:
|
||||||
|
- input
|
||||||
|
- output
|
||||||
|
values:
|
||||||
|
- _fieldName: input
|
||||||
|
_node: {fileID: 114463302483022418}
|
||||||
|
_typeQualifiedName: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral,
|
||||||
|
PublicKeyToken=b77a5c561934e089
|
||||||
|
connections:
|
||||||
|
- fieldName: output
|
||||||
|
node: {fileID: 114880916489599218}
|
||||||
|
reroutePoints: []
|
||||||
|
_direction: 0
|
||||||
|
_connectionType: 0
|
||||||
|
_typeConstraint: 0
|
||||||
|
_dynamic: 0
|
||||||
|
- _fieldName: output
|
||||||
|
_node: {fileID: 114463302483022418}
|
||||||
|
_typeQualifiedName: System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral,
|
||||||
|
PublicKeyToken=b77a5c561934e089
|
||||||
|
connections: []
|
||||||
|
_direction: 1
|
||||||
|
_connectionType: 0
|
||||||
|
_typeConstraint: 0
|
||||||
|
_dynamic: 0
|
||||||
|
input: 1
|
||||||
output: 0
|
output: 0
|
||||||
--- !u!114 &114481634605117190
|
--- !u!114 &114481634605117190
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -167,7 +209,7 @@ MonoBehaviour:
|
|||||||
_connectionType: 0
|
_connectionType: 0
|
||||||
_typeConstraint: 0
|
_typeConstraint: 0
|
||||||
_dynamic: 0
|
_dynamic: 0
|
||||||
input: 0
|
input: 1
|
||||||
output: 0
|
output: 0
|
||||||
--- !u!114 &114880916489599218
|
--- !u!114 &114880916489599218
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -207,12 +249,15 @@ MonoBehaviour:
|
|||||||
- fieldName: input
|
- fieldName: input
|
||||||
node: {fileID: 114945579453429622}
|
node: {fileID: 114945579453429622}
|
||||||
reroutePoints: []
|
reroutePoints: []
|
||||||
|
- fieldName: input
|
||||||
|
node: {fileID: 114463302483022418}
|
||||||
|
reroutePoints: []
|
||||||
_direction: 1
|
_direction: 1
|
||||||
_connectionType: 0
|
_connectionType: 0
|
||||||
_typeConstraint: 0
|
_typeConstraint: 0
|
||||||
_dynamic: 0
|
_dynamic: 0
|
||||||
input: 0
|
input: 0
|
||||||
output: 0
|
output: 1
|
||||||
--- !u!114 &114944478030018250
|
--- !u!114 &114944478030018250
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -242,7 +287,7 @@ MonoBehaviour:
|
|||||||
_connectionType: 0
|
_connectionType: 0
|
||||||
_typeConstraint: 0
|
_typeConstraint: 0
|
||||||
_dynamic: 0
|
_dynamic: 0
|
||||||
interval: 1
|
interval: 1.06
|
||||||
output: 0
|
output: 0
|
||||||
--- !u!114 &114945579453429622
|
--- !u!114 &114945579453429622
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -289,5 +334,5 @@ MonoBehaviour:
|
|||||||
_connectionType: 0
|
_connectionType: 0
|
||||||
_typeConstraint: 0
|
_typeConstraint: 0
|
||||||
_dynamic: 0
|
_dynamic: 0
|
||||||
input: 0
|
input: 1
|
||||||
output: 0
|
output: 1
|
||||||
|
|||||||
@ -2,10 +2,10 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace XNode.Examples.LogicToy {
|
namespace XNode.Examples.LogicToy {
|
||||||
[NodeWidth(140)]
|
[NodeWidth(140), NodeTint(100, 70, 70)]
|
||||||
public class AndNode : LogicNode {
|
public class AndNode : LogicNode {
|
||||||
[Input] public bool input;
|
[Input, HideInInspector] public bool input;
|
||||||
[Output] public bool output;
|
[Output, HideInInspector] public bool output;
|
||||||
public override bool led { get { return output; } }
|
public override bool led { get { return output; } }
|
||||||
|
|
||||||
protected override void OnInputChanged() {
|
protected override void OnInputChanged() {
|
||||||
|
|||||||
@ -2,10 +2,10 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace XNode.Examples.LogicToy {
|
namespace XNode.Examples.LogicToy {
|
||||||
[NodeWidth(140)]
|
[NodeWidth(140), NodeTint(100, 100, 50)]
|
||||||
public class NotNode : LogicNode {
|
public class NotNode : LogicNode {
|
||||||
[Input] public bool input;
|
[Input, HideInInspector] public bool input;
|
||||||
[Output] public bool output = true;
|
[Output, HideInInspector] public bool output = true;
|
||||||
public override bool led { get { return output; } }
|
public override bool led { get { return output; } }
|
||||||
|
|
||||||
protected override void OnInputChanged() {
|
protected override void OnInputChanged() {
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace XNode.Examples.LogicToy {
|
namespace XNode.Examples.LogicToy {
|
||||||
[NodeWidth(140)]
|
[NodeWidth(140), NodeTint(70,100,70)]
|
||||||
public class PulseNode : LogicNode, ITimerTick {
|
public class PulseNode : LogicNode, ITimerTick {
|
||||||
|
[Space(-18)]
|
||||||
public float interval = 1f;
|
public float interval = 1f;
|
||||||
[Output] public bool output;
|
[Output, HideInInspector] public bool output;
|
||||||
public override bool led { get { return output; } }
|
public override bool led { get { return output; } }
|
||||||
|
|
||||||
private float timer;
|
private float timer;
|
||||||
|
|||||||
@ -2,10 +2,10 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace XNode.Examples.LogicToy {
|
namespace XNode.Examples.LogicToy {
|
||||||
[NodeWidth(140)]
|
[NodeWidth(140), NodeTint(70,70,100)]
|
||||||
public class ToggleNode : LogicNode {
|
public class ToggleNode : LogicNode {
|
||||||
[Input] public bool input;
|
[Input, HideInInspector] public bool input;
|
||||||
[Output] public bool output;
|
[Output, HideInInspector] public bool output;
|
||||||
public override bool led { get { return output; } }
|
public override bool led { get { return output; } }
|
||||||
|
|
||||||
protected override void OnInputChanged() {
|
protected override void OnInputChanged() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user