public static ReorderableList GetList(SerializedProperty property, ReorderableAttribute attrib, int id) { if (property == null) { return(null); } ReorderableList list = null; SerializedProperty array = property.FindPropertyRelative("array"); if (array != null && array.isArray) { if (!lists.TryGetValue(id, out list)) { if (attrib != null) { Texture icon = !string.IsNullOrEmpty(attrib.elementIconPath) ? AssetDatabase.GetCachedIcon(attrib.elementIconPath) : null; list = new ReorderableList(array, attrib.add, attrib.remove, attrib.draggable, ReorderableList.ElementDisplayType.Auto, attrib.elementNameProperty, attrib.elementNameOverride, icon); } else { list = new ReorderableList(array, true, true, true); } lists.Add(id, list); } else { list.List = array; } } return(list); }
public static ReorderableList GetList(SerializedProperty property, ReorderableAttribute attrib) { return(GetList(property, attrib, GetListId(property))); }