Class ReorderableListGUI
Utility class for drawing reorderable lists.
Inheritance
ReorderableListGUI
Syntax
public static class ReorderableListGUI
Fields
DefaultItemHeight
Default list item height is 18 pixels.
Declaration
public const float DefaultItemHeight = 18F
Field Value
Properties
CurrentItemIndex
Gets the zero-based index of the list item that is currently being drawn;
or a value of -1 if no item is currently being drawn.
Declaration
public static int CurrentItemIndex { get; }
Property Value
CurrentItemTotalPosition
Gets the total position of the list item that is currently being drawn.
Declaration
public static Rect CurrentItemTotalPosition { get; }
Property Value
CurrentListControlID
Gets the control ID of the list that is currently being drawn.
Declaration
public static int CurrentListControlID { get; }
Property Value
CurrentListPosition
Gets the position of the list control that is currently being drawn.
Declaration
public static Rect CurrentListPosition { get; }
Property Value
IndexOfChangedItem
Gets or sets the zero-based index of the last item that was changed. A value of -1
indicates that no item was changed by list.
Declaration
public static int IndexOfChangedItem { get; }
Property Value
Methods
CalculateListFieldHeight(Int32)
Calculate height of list field for absolute positioning.
Declaration
public static float CalculateListFieldHeight(int itemCount)
Parameters
Type |
Name |
Description |
Int32 |
itemCount |
|
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(Int32, Single)
Calculate height of list field for absolute positioning.
Declaration
public static float CalculateListFieldHeight(int itemCount, float itemHeight)
Parameters
Type |
Name |
Description |
Int32 |
itemCount |
|
Single |
itemHeight |
|
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(Int32, Single, ReorderableListFlags)
Calculate height of list field for absolute positioning.
Declaration
public static float CalculateListFieldHeight(int itemCount, float itemHeight, ReorderableListFlags flags)
Parameters
Type |
Name |
Description |
Int32 |
itemCount |
Count of items in list.
|
Single |
itemHeight |
Fixed height of list item.
|
ReorderableListFlags |
flags |
Optional flags to pass into list field.
|
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(Int32, ReorderableListFlags)
Calculate height of list field for absolute positioning.
Declaration
public static float CalculateListFieldHeight(int itemCount, ReorderableListFlags flags)
Parameters
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(IReorderableListAdaptor)
Calculate height of list field for adapted collection.
Declaration
public static float CalculateListFieldHeight(IReorderableListAdaptor adaptor)
Parameters
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(IReorderableListAdaptor, ReorderableListFlags)
Calculate height of list field for adapted collection.
Declaration
public static float CalculateListFieldHeight(IReorderableListAdaptor adaptor, ReorderableListFlags flags)
Parameters
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(SerializedProperty)
Calculate height of list field for absolute positioning.
Declaration
public static float CalculateListFieldHeight(SerializedProperty arrayProperty)
Parameters
Returns
Type |
Description |
Single |
Required list height in pixels.
|
CalculateListFieldHeight(SerializedProperty, ReorderableListFlags)
Calculate height of list field for absolute positioning.
Declaration
public static float CalculateListFieldHeight(SerializedProperty arrayProperty, ReorderableListFlags flags)
Parameters
Returns
Type |
Description |
Single |
Required list height in pixels.
|
DefaultItemDrawer<T>(Rect, T)
Default list item drawer implementation.
Declaration
public static T DefaultItemDrawer<T>(Rect position, T item)
Parameters
Type |
Name |
Description |
Rect |
position |
Position to draw list item control(s).
|
T |
item |
Value of list item.
|
Returns
Type |
Description |
T |
Unmodified value of list item.
|
Type Parameters
Name |
Description |
T |
Type of list item.
|
ListField(IReorderableListAdaptor)
Declaration
public static void ListField(IReorderableListAdaptor adaptor)
Parameters
ListField(IReorderableListAdaptor, ReorderableListControl.DrawEmpty)
Declaration
public static void ListField(IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmpty drawEmpty)
Parameters
ListField(IReorderableListAdaptor, ReorderableListControl.DrawEmpty, ReorderableListFlags)
Declaration
public static void ListField(IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags)
Parameters
ListField(IReorderableListAdaptor, ReorderableListFlags)
Declaration
public static void ListField(IReorderableListAdaptor adaptor, ReorderableListFlags flags)
Parameters
ListField(SerializedProperty)
Declaration
public static void ListField(SerializedProperty arrayProperty)
Parameters
ListField(SerializedProperty, Single)
Declaration
public static void ListField(SerializedProperty arrayProperty, float fixedItemHeight)
Parameters
ListField(SerializedProperty, Single, ReorderableListControl.DrawEmpty)
Declaration
public static void ListField(SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListControl.DrawEmpty drawEmpty)
Parameters
ListField(SerializedProperty, Single, ReorderableListControl.DrawEmpty, ReorderableListFlags)
Declaration
public static void ListField(SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags)
Parameters
ListField(SerializedProperty, Single, ReorderableListFlags)
Declaration
public static void ListField(SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListFlags flags)
Parameters
ListField(SerializedProperty, ReorderableListControl.DrawEmpty)
Declaration
public static void ListField(SerializedProperty arrayProperty, ReorderableListControl.DrawEmpty drawEmpty)
Parameters
ListField(SerializedProperty, ReorderableListControl.DrawEmpty, ReorderableListFlags)
Declaration
public static void ListField(SerializedProperty arrayProperty, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags)
Parameters
ListField(SerializedProperty, ReorderableListFlags)
Declaration
public static void ListField(SerializedProperty arrayProperty, ReorderableListFlags flags)
Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, Single)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, float itemHeight)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, Single, ReorderableListFlags)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, float itemHeight, ReorderableListFlags flags)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmpty)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmpty drawEmpty)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmpty, Single)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmpty drawEmpty, float itemHeight)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmpty, Single, ReorderableListFlags)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmpty drawEmpty, float itemHeight, ReorderableListFlags flags)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmpty, ReorderableListFlags)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags)
Parameters
Type Parameters
ListField<T>(IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListFlags)
Declaration
public static void ListField<T>(IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListFlags flags)
Parameters
Type Parameters
ListFieldAbsolute(Rect, IReorderableListAdaptor)
Declaration
public static void ListFieldAbsolute(Rect position, IReorderableListAdaptor adaptor)
Parameters
ListFieldAbsolute(Rect, IReorderableListAdaptor, ReorderableListControl.DrawEmptyAbsolute)
Declaration
public static void ListFieldAbsolute(Rect position, IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmptyAbsolute drawEmpty)
Parameters
ListFieldAbsolute(Rect, IReorderableListAdaptor, ReorderableListControl.DrawEmptyAbsolute, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute(Rect position, IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmptyAbsolute drawEmpty, ReorderableListFlags flags)
Parameters
ListFieldAbsolute(Rect, IReorderableListAdaptor, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute(Rect position, IReorderableListAdaptor adaptor, ReorderableListFlags flags)
Parameters
ListFieldAbsolute(Rect, SerializedProperty)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, Single)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, float fixedItemHeight)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, Single, ReorderableListControl.DrawEmptyAbsolute)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListControl.DrawEmptyAbsolute drawEmpty)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, Single, ReorderableListControl.DrawEmptyAbsolute, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListControl.DrawEmptyAbsolute drawEmpty, ReorderableListFlags flags)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, Single, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListFlags flags)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, ReorderableListControl.DrawEmptyAbsolute)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, ReorderableListControl.DrawEmptyAbsolute drawEmpty)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, ReorderableListControl.DrawEmptyAbsolute, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, ReorderableListControl.DrawEmptyAbsolute drawEmpty, ReorderableListFlags flags)
Parameters
ListFieldAbsolute(Rect, SerializedProperty, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute(Rect position, SerializedProperty arrayProperty, ReorderableListFlags flags)
Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, Single)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, float itemHeight)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, Single, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, float itemHeight, ReorderableListFlags flags)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmptyAbsolute)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmptyAbsolute drawEmpty)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmptyAbsolute, Single)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmptyAbsolute drawEmpty, float itemHeight)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmptyAbsolute, Single, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmptyAbsolute drawEmpty, float itemHeight, ReorderableListFlags flags)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListControl.DrawEmptyAbsolute, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListControl.DrawEmptyAbsolute drawEmpty, ReorderableListFlags flags)
Parameters
Type Parameters
ListFieldAbsolute<T>(Rect, IList<T>, ReorderableListControl.ItemDrawer<T>, ReorderableListFlags)
Declaration
public static void ListFieldAbsolute<T>(Rect position, IList<T> list, ReorderableListControl.ItemDrawer<T> drawItem, ReorderableListFlags flags)
Parameters
Type Parameters
TextFieldItemDrawer(Rect, String)
Draws text field allowing list items to be edited.
Declaration
public static string TextFieldItemDrawer(Rect position, string item)
Parameters
Type |
Name |
Description |
Rect |
position |
Position to draw list item control(s).
|
String |
item |
Value of list item.
|
Returns
Type |
Description |
String |
Modified value of list item.
|
Title(String)
Draw title control for list field.
Declaration
public static void Title(string title)
Parameters
Type |
Name |
Description |
String |
title |
Text for title control.
|
Examples
ReorderableListGUI.Title("Your Title");
ReorderableListGUI.ListField(list, DynamicListGU.TextFieldItemDrawer);
ReorderableListGUI.Title('Your Title');
ReorderableListGUI.ListField(list, DynamicListGU.TextFieldItemDrawer);
Title(GUIContent)
Draw title control for list field.
Declaration
public static void Title(GUIContent title)
Parameters
Type |
Name |
Description |
GUIContent |
title |
Content for title control.
|
Examples
ReorderableListGUI.Title(titleContent);
ReorderableListGUI.ListField(list, DynamicListGU.TextFieldItemDrawer);
ReorderableListGUI.Title(titleContent);
ReorderableListGUI.ListField(list, DynamicListGU.TextFieldItemDrawer);
Title(Rect, String)
Draw title control for list field with absolute positioning.
Declaration
public static void Title(Rect position, string text)
Parameters
Type |
Name |
Description |
Rect |
position |
Position of control.
|
String |
text |
Text for title control.
|
Title(Rect, GUIContent)
Draw title control for list field with absolute positioning.
Declaration
public static void Title(Rect position, GUIContent title)
Parameters
Type |
Name |
Description |
Rect |
position |
Position of control.
|
GUIContent |
title |
Content for title control.
|