Created
October 8, 2014 22:04
-
-
Save DomDomHaas/14ecf139013041ad244f to your computer and use it in GitHub Desktop.
ReorderableList for Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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