1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00

PropertyField null check and default includeChildren value

This commit is contained in:
Thor Kramer Brigsted 2017-11-01 17:41:43 +01:00
parent ab74f8fd36
commit ace1e8ccd8

View File

@ -9,7 +9,8 @@ using UnityEngine;
/// <summary> UNEC-specific version of <see cref="EditorGUILayout"/> </summary> /// <summary> UNEC-specific version of <see cref="EditorGUILayout"/> </summary>
public static class NodeEditorGUILayout { public static class NodeEditorGUILayout {
public static void PropertyField(SerializedProperty property, bool includeChildren) { public static void PropertyField(SerializedProperty property, bool includeChildren = true) {
if (property == null) throw new NullReferenceException();
Node node = property.serializedObject.targetObject as Node; Node node = property.serializedObject.targetObject as Node;
NodePort port = node.GetPortByFieldName(property.name); NodePort port = node.GetPortByFieldName(property.name);