5 namespace HKI.Core.Editor.Misc
13 ReorderableList list = null;
16 public StandardReorderableList(SerializedObject serializedObject,
string propertyName,
string label,
bool useSelect =
true)
18 list =
new ReorderableList(serializedObject, serializedObject.FindProperty(propertyName),
true,
false,
true,
true);
19 list.drawHeaderCallback = (Rect rect) =>
21 EditorGUI.LabelField(rect, label);
24 list.drawElementCallback = (Rect rect,
int index,
bool isActive,
bool isFocused) =>
26 Rect propertyRect = rect;
28 propertyRect.height = EditorGUIUtility.singleLineHeight;
29 EditorGUI.PropertyField(propertyRect, list.serializedProperty.GetArrayElementAtIndex(index), GUIContent.none);
34 list.onSelectCallback = (ReorderableList l) =>
36 Object obj = l.serializedProperty.GetArrayElementAtIndex(l.index).objectReferenceValue;
38 EditorGUIUtility.PingObject(obj);
This class provides you with a better handling of ReorderableList so that ReorderableLists can be use...
StandardReorderableList(SerializedObject serializedObject, string propertyName, string label, bool useSelect=true)