示例#1
0
        void ApplyMesh(Mesh mesh, IList <Quad> quads, IList <Vector3> vertsShared,
                       IList <Vector2> uvs, IList <Vector3> normsShared = null, bool indep = false)
        {
            var verts   = indep ? Quad.ToVertsIndep(quads, vertsShared) : ListTool.IListToArray(vertsShared);
            var indices = Quad.ToIndices(quads, indep);

            mesh.vertices = verts;
            mesh.uv       = Quad.ToUVsIndep(quads);
            mesh.SetIndices(indices, MeshTopology.Triangles, 0);
            if (normsShared != null)
            {
                mesh.normals = Quad.ToNormals(quads, normsShared, indep);
            }
            if (recalculateNormals)
            {
                mesh.RecalculateNormals();
            }
            if (recalculateTangents)
            {
                mesh.RecalculateTangents();
            }
        }
示例#2
0
 public void ApplyShared()
 {
     _mesh.vertices  = Quad.ToVertsIndep(quads, vertexShared);
     _mesh.triangles = Quad.ToIndices(quads, true);
 }