From dc608a3d1ba6cf8de2c8ff3571ecf308d8b71c3b Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Thu, 1 Nov 2018 00:46:38 +0100 Subject: [PATCH] Added NodeEditorGUILayout.onCreateReorderableList action for reorderablelist customization --- Scripts/Editor/NodeEditorGUILayout.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index bcc142b..c1c1665 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -11,8 +11,11 @@ namespace XNodeEditor { /// xNode-specific version of public static class NodeEditorGUILayout { + /// Listen for this event if you want to alter the default ReorderableList + public static Action onCreateReorderableList; private static readonly Dictionary> reorderableListCache = new Dictionary>(); private static int reorderableListIndex = -1; + /// Make a field for a serialized property. Automatically displays relevant node port. public static void PropertyField(SerializedProperty property, bool includeChildren = true, params GUILayoutOption[] options) { PropertyField(property, (GUIContent) null, includeChildren, options); @@ -410,6 +413,7 @@ namespace XNodeEditor { serializedObject.ApplyModifiedProperties(); serializedObject.Update(); } + if (onCreateReorderableList != null) onCreateReorderableList(list); return list; } }