Constraint ConvertToConstraint(ResizableConstraint menuConstraint)
        {
            Constraint returnEnum = Constraint.FixedColumnCount;

            if (menuConstraint == ResizableConstraint.FixedRowCount)
            {
                returnEnum = Constraint.FixedRowCount;
            }
            return(returnEnum);
        }
        Vector2 CalculateCellSize(ResizableConstraint menuConstraint, int constraintQuantity)
        {
            // Calculate the number of columns and rows (assuming menuConstraint is set to default, i.e. FixedColumnCount)
            int numColumns = Mathf.Max(constraintQuantity, 1);
            int numRows    = Mathf.Max((rectChildren.Count / numColumns), 1);

            if ((rectChildren.Count % numColumns) > 0)
            {
                ++numRows;
            }

            // Check if menuConstraint is actually set to default (i.e. FixedColumnCount)
            if (menuConstraint == ResizableConstraint.FixedRowCount)
            {
                // If not, swap the values
                int swap = numColumns;
                numColumns = numRows;
                numRows    = swap;
            }

            // Calculate how much space all the buttons cumulatively takes
            tempCellSize = CachedRectTransform.rect.size;

            // Take out all the padding
            tempCellSize.x -= padding.left;
            tempCellSize.x -= padding.right;
            tempCellSize.y -= padding.top;
            tempCellSize.y -= padding.bottom;

            // Take out the button spacing
            tempCellSize.x -= (spacing.x * (numColumns - 1));
            tempCellSize.y -= (spacing.y * (numRows - 1));

            // Divide the cumulative space by the number of columns and rows
            tempCellSize.x /= numColumns;
            tempCellSize.y /= numRows;

            // Return the cell size
            return(tempCellSize);
        }