예제 #1
0
        public void Begin(SpriteMeshInfo info)
        {
            sizeOnly        = false;
            trianglesOffset = 0;
            verticesOffset  = 0;
            z     = 0.0f;
            scale = 1.0f;

            //screenWidth = Screen.width;
            //screenHeight = Screen.height;

            if (triangles == null || triangles.Length != info.triangles)
            {
                triangles = new int[info.triangles];
                mesh.Clear();
            }

            if (uvs == null || uvs.Length != info.vertices)
            {
                uvs = new Vector2[info.vertices];
            }

            if (positions == null || positions.Length != info.vertices)
            {
                positions = new Vector3[info.vertices];
                mesh.Clear();
            }

            if (colors == null || colors.Length != info.vertices)
            {
                colors = new Color32[info.vertices];
            }
        }
예제 #2
0
        public SpriteMeshInfo End()
        {
            SpriteMeshInfo info = new SpriteMeshInfo();

            info.triangles = trianglesOffset;
            info.vertices  = verticesOffset;

            return(info);
        }