예제 #1
0
        public override void SetLayoutHorizontal()
        {
            if (horizontal != null && !locked)
            {
#if DEBUG_LAYOUT
                PUIUtils.LogUIDebug("SetLayoutHorizontal for {0} resolved width to {1:F2}".F(
                                        gameObject.name, rectTransform.rect.width));
#endif
                DoLayout(parameters, horizontal, rectTransform.rect.width);
            }
        }
예제 #2
0
        public override void SetLayoutVertical()
        {
            if (vertical != null && !locked)
            {
#if DEBUG_LAYOUT
                PUIUtils.LogUIDebug("SetLayoutVertical for {0} resolved height to {1:F2}".F(
                                        gameObject.name, rectTransform.rect.height));
#endif
                DoLayout(parameters, vertical, rectTransform.rect.height);
            }
        }
예제 #3
0
        public void CalculateLayoutInputVertical()
        {
#if DEBUG_LAYOUT
            PUIUtils.LogUIDebug("CalculateLayoutInputVertical for " + gameObject.name);
#endif
            var   margin = parameters.Margin;
            float gap    = (margin == null) ? 0.0f : margin.top + margin.bottom;
            vertical = Calc(gameObject, parameters, PanelDirection.Vertical);
            var vTotal = vertical.total;
            minHeight       = vTotal.min + gap;
            preferredHeight = vTotal.preferred + gap;
        }
예제 #4
0
        public void CalculateLayoutInputHorizontal()
        {
#if DEBUG_LAYOUT
            PUIUtils.LogUIDebug("CalculateLayoutInputHorizontal for " + gameObject.name);
#endif
            var   margin = parameters.Margin;
            float gap    = (margin == null) ? 0.0f : margin.left + margin.right;
            horizontal = Calc(gameObject, parameters, PanelDirection.Horizontal);
            var hTotal = horizontal.total;
            minWidth       = hTotal.min + gap;
            preferredWidth = hTotal.preferred + gap;
        }
예제 #5
0
        public override void CalculateLayoutInputVertical()
        {
            if (!locked)
            {
                var   margin = parameters.Margin;
                float gap    = (margin == null) ? 0.0f : margin.top + margin.bottom;
                vertical = Calc(gameObject, parameters, PanelDirection.Vertical);
                var vTotal = vertical.total;
                minHeight       = vTotal.min + gap;
                preferredHeight = vTotal.preferred + gap;
#if DEBUG_LAYOUT
                PUIUtils.LogUIDebug("CalculateLayoutInputVertical for {0} preferred {1:F2}".F(
                                        gameObject.name, preferredHeight));
#endif
            }
        }
예제 #6
0
        public override void CalculateLayoutInputHorizontal()
        {
            if (!locked)
            {
                var   margin = parameters.Margin;
                float gap    = (margin == null) ? 0.0f : margin.left + margin.right;
                horizontal = Calc(gameObject, parameters, PanelDirection.Horizontal);
                var hTotal = horizontal.total;
                minWidth       = hTotal.min + gap;
                preferredWidth = hTotal.preferred + gap;
#if DEBUG_LAYOUT
                PUIUtils.LogUIDebug("CalculateLayoutInputHorizontal for {0} preferred {1:F2}".
                                    F(gameObject.name, preferredWidth));
#endif
            }
        }
예제 #7
0
        public void SetLayoutVertical()
        {
#if DEBUG
            if (vertical == null)
            {
                throw new InvalidOperationException("SetLayoutVertical before CalculateLayoutInputVertical");
            }
#endif
#if DEBUG_LAYOUT
            PUIUtils.LogUIDebug("SetLayoutVertical for " + gameObject.name);
#endif
            if (vertical != null)
            {
                var rt = gameObject.rectTransform();
                DoLayout(parameters, vertical, rt.rect.size.y);
            }
        }
예제 #8
0
        public override void SetLayoutVertical()
        {
#if DEBUG
            if (vertical == null)
            {
                throw new InvalidOperationException("SetLayoutVertical before CalculateLayoutInputVertical");
            }
#endif
            if (vertical != null)
            {
                var rt = gameObject.rectTransform();
#if DEBUG_LAYOUT
                PUIUtils.LogUIDebug("SetLayoutVertical for {0} resolved height to {1:F2}".F(
                                        gameObject.name, rt.rect.height));
#endif
                DoLayout(parameters, vertical, rt.rect.height);
            }
        }
예제 #9
0
        public void SetLayoutHorizontal()
        {
#if DEBUG
            if (horizontal == null)
            {
                throw new InvalidOperationException("SetLayoutHorizontal before CalculateLayoutInputHorizontal");
            }
#endif
            if (horizontal != null)
            {
                var rt = gameObject.rectTransform();
#if DEBUG_LAYOUT
                PUIUtils.LogUIDebug("SetLayoutHorizontal for {0} resolved width to {1:F2}".F(
                                        gameObject.name, rt.rect.width));
#endif
                DoLayout(parameters, horizontal, rt.rect.width);
            }
        }