Example #1
0
    private void SizeRows()
    {
        float num  = 0f;
        float num2 = 0f;
        int   num3 = 0;

        for (int i = 0; i < header_row.transform.childCount; i++)
        {
            Transform     child     = header_row.transform.GetChild(i);
            LayoutElement component = child.GetComponent <LayoutElement>();
            if ((UnityEngine.Object)component != (UnityEngine.Object)null && !component.ignoreLayout)
            {
                num3++;
                num += component.minWidth;
            }
            else
            {
                HorizontalOrVerticalLayoutGroup component2 = child.GetComponent <HorizontalOrVerticalLayoutGroup>();
                if ((UnityEngine.Object)component2 != (UnityEngine.Object)null)
                {
                    Vector2 sizeDelta = component2.rectTransform().sizeDelta;
                    float   x         = sizeDelta.x;
                    num += x;
                    num3++;
                }
            }
        }
        float width = base.gameObject.rectTransform().rect.width;

        num2 = 0f;
        HorizontalLayoutGroup component3 = header_row.GetComponent <HorizontalLayoutGroup>();

        component3.spacing        = num2;
        component3.childAlignment = TextAnchor.MiddleLeft;
        foreach (TableRow row in rows)
        {
            row.transform.GetComponentInChildren <HorizontalLayoutGroup>().spacing = num2;
        }
    }