Exemplo n.º 1
0
        public void UpdateTextHeight()
        {
            renderCache.Release();
            mLines.Clear();
            float width = rectTransform.rect.width;

            if (width <= 0f)
            {
                width = 10f;
            }

            d_Around.Clear();
            foreach (NodeBase node in mNodeList)
            {
                if (node is RectSpriteNode)
                {
                    RectSpriteNode rsn = node as RectSpriteNode;
                    d_Around.Add(rsn.rect);
                }
            }

            mLines.Add(new Line(Vector2.zero));
            Vector2 currentpos = Vector2.zero;
            float   scale      = pixelsPerUnit;

            foreach (NodeBase node in mNodeList)
            {
                node.fill(ref currentpos, mLines, width, scale);
            }

            for (int i = 0; i < mLines.Count; ++i)
            {
                mLines[i].y = Mathf.Max(mLines[i].y, m_MinLineHeight);
            }
        }