/// <summary> /// Perform layout. /// </summary> /// <param name="setPositions">Is need to set elements position?</param> protected void PerformLayout(bool setPositions) { if (LayoutGroup == null) { Debug.LogWarning("Layout group not found: " + LayoutType); return; } var size = LayoutGroup.PerformLayout(elements, setPositions); UISize = elements.Count > 0 ? new Vector2(size.x, size.y) : Vector2.zero; BlockSize = new Vector2(UISize.x + MarginHorizontal, UISize.y + MarginVertical); }