ReorderableListControl..::..DrawEmpty Delegate

Invoked to draw content for empty list.
public delegate void DrawEmpty()

Remarks

Callback should make use of GUILayout to present controls.

Examples

The following listing displays a label for empty list control:

C# UnityScript
CopyC#
using UnityEngine;
using UnityEditor;

using System.Collections.Generic;

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);
    }
}
CopyUnityScript
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);
    }
}