示例#1
0
    public override void UpdateLayoutElement()
    {
        float preferredHeight = 0.0f;

        foreach (DateUI dateUI in dateUIlist_)
        {
            float     datePreferredHeight = 0;
            Transform parent = dateUI.GetComponentInChildren <VerticalLayoutGroup>().transform;
            for (int i = 0; i < parent.childCount; ++i)
            {
                LogTree logTree = parent.GetChild(i).GetComponent <LogTree>();
                if (logTree != null && logTree.gameObject.activeInHierarchy)
                {
                    logTree.UpdateLayoutElement(applyMinHeight: false);
                    datePreferredHeight += logTree.GetComponent <LayoutElement>().preferredHeight;
                }
                else if (parent.GetChild(i).GetComponent <LogTitleText>() != null)
                {
                    datePreferredHeight += 30;
                }
            }
            datePreferredHeight = Math.Max(GameContext.Config.MinLogTreeHeight, datePreferredHeight);
            dateUI.GetComponent <LayoutElement>().preferredHeight = datePreferredHeight;
            preferredHeight += datePreferredHeight + 5;
        }
        preferredHeight        += 200;
        layout_.preferredHeight = preferredHeight;
        contentSizeFitter_.SetLayoutVertical();
    }