Exemplo n.º 1
0
 protected virtual void WriteMesh()
 {
     MeshUtility.InverseTransformMesh(tsMesh, transform);
     if (_doubleSided)
     {
         MeshUtility.MakeDoublesidedHalf(tsMesh);
     }
     else if (_flipFaces)
     {
         MeshUtility.FlipFaces(tsMesh);
     }
     if (_tangents)
     {
         MeshUtility.CalculateTangents(tsMesh);
     }
     if (tsMesh.vertexCount > 64000)
     {
         Debug.LogError("WARNING: The generated mesh for " + name + " has " + tsMesh.vertexCount + " vertices. The maximum vertex count for meshes in Unity is 64000. The mesh will not be updated.");
     }
     tsMesh.WriteMesh(ref mesh);
     if (_normalMethod == 0)
     {
         mesh.RecalculateNormals();
     }
     if (filter != null)
     {
         filter.sharedMesh = mesh;
     }
     updateCollider = true;
 }
Exemplo n.º 2
0
 protected virtual void WriteMesh()
 {
     MeshUtility.InverseTransformMesh(tsMesh, this.transform);
     if (_doubleSided)
     {
         MeshUtility.MakeDoublesided(tsMesh);
     }
     else if (_flipFaces)
     {
         MeshUtility.FlipFaces(tsMesh);
     }
     if (_tangents)
     {
         MeshUtility.CalculateTangents(tsMesh);
     }
     tsMesh.WriteMesh(ref mesh);
     if (_normalMethod == 0)
     {
         mesh.RecalculateNormals();
     }
     if (filter != null)
     {
         filter.sharedMesh = mesh;
     }
     updateCollider = true;
 }