ReorderableListControlItemDrawerT Delegate |
Namespace: Rotorz.ReorderableList
public delegate T ItemDrawer<T>( Rect position, T item )
GUI controls must be positioned absolutely within the given rectangle since list items must be sized consistently.
The following listing presents a text field for each list item:
using Rotorz.ReorderableList; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class ExampleWindow : EditorWindow { public List<string> wishlist = new List<string>(); private void OnGUI() { ReorderableListGUI.ListField(wishlist, DrawListItem); } private string DrawListItem(Rect position, string value) { // Text fields do not like `null` values! if (value == null) value = ""; return EditorGUI.TextField(position, value); } }