Ejemplo n.º 1
0
        protected override void OnPopulateMesh(Mesh toFill)
        {
            if (font == null)
            {
                return;
            }

            if (TextGenerator.IsRequestingCharactersInTexture)
            {
                return;
            }

            //フォントの再作成によるものであればその旨を通知
            if (!isDirtyVerts)
            {
                TextGenerator.IsRebuidFont = true;
            }

            IList <UIVertex> verts = TextGenerator.CreateVertex();

            using (var vh = new VertexHelper())
            {
                for (int i = 0; i < verts.Count; ++i)
                {
                    int tempVertsIndex = i & 3;
                    m_TempVerts[tempVertsIndex] = verts[i];
                    if (tempVertsIndex == 3)
                    {
                        vh.AddUIVertexQuad(m_TempVerts);
                    }
                }
                vh.FillMesh(toFill);
            }
            isDirtyVerts = false;
        }
Ejemplo n.º 2
0
        protected override void OnPopulateMesh(VertexHelper vh)
        {
            if (font == null)
            {
                return;
            }

/*
 *          if (TextGenerator.IsRequestingCharactersInTexture)
 *          {
 *              return;
 *          }
 *
 *          //フォントの再作成によるものであればその旨を通知
 *          if (!isDirtyVerts)
 *          {
 *              TextGenerator.IsRebuidFont = true;
 *          }
 */
            var verts = ListPool <UIVertex> .Get();

            TextGenerator.CreateVertex(verts);
            vh.Clear();
            for (int i = 0; i < verts.Count; ++i)
            {
                int tempVertsIndex = i & 3;
                m_TempVerts[tempVertsIndex] = verts[i];
                if (tempVertsIndex == 3)
                {
                    vh.AddUIVertexQuad(m_TempVerts);
                }
            }
            ListPool <UIVertex> .Release(verts);
        }
Ejemplo n.º 3
0
        //頂点情報を作成
        /// <summary>
        /// Draw the Text.
        /// </summary>
#if UNITY_4_6 || UNITY_5_0 || UNITY_5_1
        protected override void OnFillVBO(List <UIVertex> vbo)
        {
            if (font == null)
            {
                return;
            }

            if (TextGenerator.IsRequestingCharactersInTexture)
            {
                return;
            }

            //フォントの再作成によるものであればその旨を通知
            if (!isDirtyVerts)
            {
                TextGenerator.IsRebuidFont = true;
            }

            IList <UIVertex> verts = TextGenerator.CreateVertex();

            vbo.AddRange(verts);
            isDirtyVerts = false;
        }