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

Null check

This commit is contained in:
Thor Brigsted 2017-10-28 19:11:13 +02:00
parent 0150a7bb81
commit b48f7d63b4

View File

@ -16,6 +16,7 @@ public class NodeEditorGUILayout {
else EditorGUILayout.LabelField(label);
Rect rect = GUILayoutUtility.GetLastRect();
if (port == null) { portPosition = rect.position; return null; }
if (port.direction == NodePort.IO.Input) rect.position = rect.position - new Vector2(16, 0);
if (port.direction == NodePort.IO.Output) rect.position = rect.position + new Vector2(rect.width, 0);
rect.size = new Vector2(16, 16);