mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Added NodeEditorGUILayout.onCreateReorderableList action for reorderablelist customization
This commit is contained in:
parent
b9bd67bd28
commit
dc608a3d1b
@ -11,8 +11,11 @@ namespace XNodeEditor {
|
|||||||
/// <summary> xNode-specific version of <see cref="EditorGUILayout"/> </summary>
|
/// <summary> xNode-specific version of <see cref="EditorGUILayout"/> </summary>
|
||||||
public static class NodeEditorGUILayout {
|
public static class NodeEditorGUILayout {
|
||||||
|
|
||||||
|
/// <summary> Listen for this event if you want to alter the default ReorderableList </summary>
|
||||||
|
public static Action<ReorderableList> onCreateReorderableList;
|
||||||
private static readonly Dictionary<UnityEngine.Object, Dictionary<string, ReorderableList>> reorderableListCache = new Dictionary<UnityEngine.Object, Dictionary<string, ReorderableList>>();
|
private static readonly Dictionary<UnityEngine.Object, Dictionary<string, ReorderableList>> reorderableListCache = new Dictionary<UnityEngine.Object, Dictionary<string, ReorderableList>>();
|
||||||
private static int reorderableListIndex = -1;
|
private static int reorderableListIndex = -1;
|
||||||
|
|
||||||
/// <summary> Make a field for a serialized property. Automatically displays relevant node port. </summary>
|
/// <summary> Make a field for a serialized property. Automatically displays relevant node port. </summary>
|
||||||
public static void PropertyField(SerializedProperty property, bool includeChildren = true, params GUILayoutOption[] options) {
|
public static void PropertyField(SerializedProperty property, bool includeChildren = true, params GUILayoutOption[] options) {
|
||||||
PropertyField(property, (GUIContent) null, includeChildren, options);
|
PropertyField(property, (GUIContent) null, includeChildren, options);
|
||||||
@ -410,6 +413,7 @@ namespace XNodeEditor {
|
|||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
serializedObject.Update();
|
serializedObject.Update();
|
||||||
}
|
}
|
||||||
|
if (onCreateReorderableList != null) onCreateReorderableList(list);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user