FullInspector.Rotorz.ReorderableList.ReorderableListControl.DrawLayoutListField C# (CSharp) Method

DrawLayoutListField() private method

Do layout version of list field.
private DrawLayoutListField ( int controlID, IReorderableListAdaptor adaptor ) : Rect
controlID int Unique ID of list control.
adaptor IReorderableListAdaptor Reorderable list adaptor.
return UnityEngine.Rect
        private Rect DrawLayoutListField(int controlID, IReorderableListAdaptor adaptor)
        {
            float totalHeight;

            // Calculate position of list field using layout engine.
            if (Event.current.type == EventType.Layout) {
                totalHeight = CalculateListHeight(adaptor);
                s_ContainerHeightCache[controlID] = totalHeight;
            }
            else {
                totalHeight = s_ContainerHeightCache.ContainsKey(controlID)
                    ? s_ContainerHeightCache[controlID]
                    : 0;
            }

            Rect position = GUILayoutUtility.GetRect(GUIContent.none, containerStyle, GUILayout.Height(totalHeight));

            // Make room for add button?
            if (hasAddButton)
                position.height -= addButtonStyle.fixedHeight;

            // Draw list as normal.
            DrawListContainerAndItems(position, controlID, adaptor);

            CheckForAutoFocusControl(controlID);

            return position;
        }