Ejemplo n.º 1
0
 /// <summary>
 /// Draw list field control for adapted collection.
 /// </summary>
 /// <param name="adaptor">Reorderable list adaptor.</param>
 /// <param name="drawEmpty">Callback to draw custom content for empty list (optional).</param>
 /// <param name="flags">Optional flags to pass into list field.</param>
 private static void DoListField(IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags = 0)
 {
     ReorderableListControl.DrawControlFromState(adaptor, drawEmpty, flags);
 }
Ejemplo n.º 2
0
 /// <inheritdoc cref="DoListField(SerializedProperty, float, ReorderableListControl.DrawEmpty, ReorderableListFlags)"/>
 public static void ListField(SerializedProperty arrayProperty, ReorderableListControl.DrawEmpty drawEmpty)
 {
     DoListField(arrayProperty, 0, drawEmpty, 0);
 }
Ejemplo n.º 3
0
 /// <inheritdoc cref="DoListField(SerializedProperty, float, ReorderableListControl.DrawEmpty, ReorderableListFlags)"/>
 public static void ListField(SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListControl.DrawEmpty drawEmpty)
 {
     DoListField(arrayProperty, fixedItemHeight, drawEmpty, 0);
 }
Ejemplo n.º 4
0
 /// <inheritdoc cref="DoListField{T}(IList{T}, ReorderableListControl.ItemDrawer{T}, ReorderableListControl.DrawEmpty, float, ReorderableListFlags)"/>
 public static void ListField <T>(IList <T> list, ReorderableListControl.ItemDrawer <T> drawItem, ReorderableListControl.DrawEmpty drawEmpty)
 {
     DoListField <T>(list, drawItem, drawEmpty, DefaultItemHeight, 0);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Draw list field control for serializable property array.
        /// </summary>
        /// <param name="arrayProperty">Serializable property.</param>
        /// <param name="fixedItemHeight">Use fixed height for items rather than <see cref="UnityEditor.EditorGUI.GetPropertyHeight(SerializedProperty)"/>.</param>
        /// <param name="drawEmpty">Callback to draw custom content for empty list (optional).</param>
        /// <param name="flags">Optional flags to pass into list field.</param>
        private static void DoListField(SerializedProperty arrayProperty, float fixedItemHeight, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags)
        {
            var adaptor = new SerializedPropertyAdaptor(arrayProperty, fixedItemHeight);

            ReorderableListControl.DrawControlFromState(adaptor, drawEmpty, flags);
        }
Ejemplo n.º 6
0
 /// <inheritdoc cref="DoListField{T}(IList{T}, ReorderableListControl.ItemDrawer{T}, ReorderableListControl.DrawEmpty, float, ReorderableListFlags)"/>
 public static void ListField <T>(IList <T> list, ReorderableListControl.ItemDrawer <T> drawItem, ReorderableListControl.DrawEmpty drawEmpty, float itemHeight, ReorderableListFlags flags)
 {
     DoListField <T>(list, drawItem, drawEmpty, itemHeight, flags);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Draw list field control.
        /// </summary>
        /// <param name="list">The list which can be reordered.</param>
        /// <param name="drawItem">Callback to draw list item.</param>
        /// <param name="drawEmpty">Callback to draw custom content for empty list (optional).</param>
        /// <param name="itemHeight">Height of a single list item.</param>
        /// <param name="flags">Optional flags to pass into list field.</param>
        /// <typeparam name="T">Type of list item.</typeparam>
        private static void DoListField <T>(IList <T> list, ReorderableListControl.ItemDrawer <T> drawItem, ReorderableListControl.DrawEmpty drawEmpty, float itemHeight, ReorderableListFlags flags)
        {
            var adaptor = new GenericListAdaptor <T>(list, drawItem, itemHeight);

            ReorderableListControl.DrawControlFromState(adaptor, drawEmpty, flags);
        }
Ejemplo n.º 8
0
 /// <inheritdoc cref="DoListField(IReorderableListAdaptor, ReorderableListControl.DrawEmpty, ReorderableListFlags)"/>
 public static void ListField(IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmpty drawEmpty)
 {
     DoListField(adaptor, drawEmpty, 0);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Draw list field control for adapted collection.
 /// </summary>
 /// <param name="adaptor">Reorderable list adaptor.</param>
 /// <param name="drawEmpty">Callback to draw custom content for empty list (optional).</param>
 /// <param name="flags">Optional flags to pass into list field.</param>
 private static void DoListField(IReorderableListAdaptor adaptor, ReorderableListControl.DrawEmpty drawEmpty, [System.ComponentModel.DefaultValue(0)] ReorderableListFlags flags)
 {
     ReorderableListControl.DrawControlFromState(adaptor, drawEmpty, flags);
 }
Ejemplo n.º 10
0
 /// <inheritdoc cref="DoListField(IReorderableListAdapter, ReorderableListControl.DrawEmpty, ReorderableListFlags)"/>
 public static void ListField(IReorderableListAdapter adapter, ReorderableListControl.DrawEmpty drawEmpty, ReorderableListFlags flags)
 {
     DoListField(adapter, drawEmpty, flags);
 }