public bool DoLayoutProperty(SerializedProperty property) { if (propIndex.ContainsKey(property.propertyPath) == false) return false; // Draw the header string headerText = string.Format("{0} [{1}]", property.displayName, property.arraySize); EditorGUILayout.PropertyField(property, new GUIContent(headerText), false); // Save header rect for handling drag and drop Rect dropRect = GUILayoutUtility.GetLastRect(); // Draw the reorderable list for the property if (property.isExpanded) { propIndex[property.propertyPath].DoLayoutList(); } // Handle drag and drop into the header Event evt = Event.current; if (evt == null) return true; if (evt.type == EventType.dragUpdated || evt.type == EventType.dragPerform) { if (dropRect.Contains(evt.mousePosition) == false) return true; DragAndDrop.visualMode = DragAndDropVisualMode.Copy; if (evt.type == EventType.DragPerform) { DragAndDrop.AcceptDrag(); foreach (Object dragged_object in DragAndDrop.objectReferences) { if (dragged_object.GetType() != property.GetType()) continue; int newIndex = property.arraySize; property.arraySize++; SerializedProperty target = property.GetArrayElementAtIndex(newIndex); target.objectReferenceInstanceIDValue = dragged_object.GetInstanceID(); } evt.Use(); } } return true; }