private void Play() { int verticesIndex = 0; int uvsIndex = 0; int trianglesIndex = 0; for (int i = 0; i < animsLength; i++) { V_Skeleton_Anim anim = anims[i]; V_Skeleton_Frame frame = anim.GetCurrentAnimFrame(); V_UnitSkeleton.AddSquare(verticesIndex, verticesArr, uvsIndex, uvsArr, trianglesIndex, trianglesArr, frame.pos, frame.v00 + frame.v00offset, frame.v01 + frame.v01offset, frame.v10 + frame.v10offset, frame.v11 + frame.v11offset, V_UnitSkeleton.GetUV_Type(frame.uvType)); verticesIndex = verticesIndex + 4; uvsIndex = uvsIndex + 4; trianglesIndex = trianglesIndex + 6; } //mesh.triangles = null; mesh.Clear(); mesh.vertices = verticesArr; mesh.uv = uvsArr; mesh.triangles = trianglesArr; }