コード例 #1
0
ファイル: EasyLayout.cs プロジェクト: zwong91/Titan
        void ResizeChild(RectTransform child)
        {
            DrivenTransformProperties driven_properties = DrivenTransformProperties.None;

            if (ChildrenWidth != ChildrenSize.DoNothing)
            {
                driven_properties |= DrivenTransformProperties.SizeDeltaX;
                var width = (max_width != -1) ? max_width : EasyLayoutUtilites.GetPreferredWidth(child);
                child.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);
            }
            if (ChildrenHeight != ChildrenSize.DoNothing)
            {
                driven_properties |= DrivenTransformProperties.SizeDeltaY;
                var height = (max_height != -1) ? max_height : EasyLayoutUtilites.GetPreferredHeight(child);
                child.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
            }

            propertiesTracker.Add(this, child, driven_properties);
        }