Ok, so this is both a question and a temporary solution. UI Toolkit does currently not support reorderable arrays and lists. What you can do for now is this:root.Add(new IMGUIContainer(() => EditorGUILayout.PropertyField(serializedObject.FindProperty("property"))));
The question is; when will UI Toolkit get this feature built in?
2 Likes
Here is an example of an extension method for reorderable lists:
public VisualElement ReorderableList(string name)
{
return new IMGUIContainer(() => { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty(name)); serializedObject.ApplyModifiedProperties(); });
}
You just liked my previous post, didn’t you!?
Good news though, it looks like this has been implemented correctly in 2021.1.0b1
1 Like
Indeed very good news.
1 Like