Reorderable List Control for Unity
ReorderableListControlDrawEmpty Delegate |
Invoked to draw content for empty list.
Namespace: Rotorz.ReorderableList
Assembly: Editor.ReorderableList (in Editor.ReorderableList.dll) Version: 0.0.0.0 (0.3.0.0)

public delegate void DrawEmpty()
public delegate DrawEmpty()

Callback should make use of GUILayout to present controls.

The following listing displays a label for empty list control:
using Rotorz.ReorderableList; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class ExampleWindow : EditorWindow { private List<string> _list; private void OnEnable() { _list = new List<string>(); } private void OnGUI() { ReorderableListGUI.ListField(_list, ReorderableListGUI.TextFieldItemDrawer, DrawEmptyMessage); } private string DrawEmptyMessage() { GUILayout.Label("List is empty!", EditorStyles.miniLabel); } }
import Rotorz.ReorderableList; import System.Collections.Generic; class ExampleWindow extends EditorWindow { private var _list:List.<String>; function OnEnable() { _list = new List.<String>(); } function OnGUI() { ReorderableListGUI.ListField(_list, ReorderableListGUI.TextFieldItemDrawer, DrawEmptyMessage); } function DrawEmptyMessage() { GUILayout.Label('List is empty!', EditorStyles.miniLabel); } }
