private ReorderableArrayEditor.ReorderableListWrapper GetReorderableListWrapper(SerializedProperty property) { ReorderableArrayEditor.ReorderableListWrapper reorderableListWrapper; if (this.reorderableLists.TryGetValue(property.name, out reorderableListWrapper)) { reorderableListWrapper.property = property; return(reorderableListWrapper); } reorderableListWrapper = new ReorderableArrayEditor.ReorderableListWrapper(property); this.reorderableLists.Add(property.name, reorderableListWrapper); return(reorderableListWrapper); }
public void DrawReorderableArray(SerializedProperty property) { HeaderAttribute propertyAttribute = ReorderableArrayEditor.GetPropertyAttribute <HeaderAttribute>(property); if (propertyAttribute != null) { EditorGUILayout.Space(); EditorGUILayout.LabelField(propertyAttribute.header, EditorStyles.boldLabel, new GUILayoutOption[0]); } ReorderableArrayEditor.ReorderableListWrapper reorderableListWrapper = this.GetReorderableListWrapper(property); if (reorderableListWrapper.isExpanded) { reorderableListWrapper.list.DoLayoutList(); } else { property.isExpanded = (EditorGUILayout.Foldout(property.isExpanded, new GUIContent(string.Format("{0} [{1}]", property.displayName, property.arraySize), property.tooltip))); } }