Skip to content

Instantly share code, notes, and snippets.

@DomDomHaas
Created October 8, 2014 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DomDomHaas/14ecf139013041ad244f to your computer and use it in GitHub Desktop.
Save DomDomHaas/14ecf139013041ad244f to your computer and use it in GitHub Desktop.
ReorderableList for Unity
private ReorderableList list;
list = new ReorderableList(property.serializedObject, property.FindPropertyRelative("tagList"), true, true, true, true);
list.drawHeaderCallback += rect => GUI.Label(rect, label);
list.drawElementCallback += (rect, index, active, focused) =>
{
rect.height = 16;
rect.y += 2;
EditorGUI.PropertyField(rect,
list.serializedProperty.GetArrayElementAtIndex(index),
GUIContent.none);
};
list.DoList(position);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment