예제 #1
0
 public void LOD(float lod)
 {
     for (int i = 0; i < meshlist.Count; i++)
     {
         Mesh original = originalMeshs[meshlist[i]];
         if (meshlist[i] is SkinnedMeshRenderer)
         {
             SkinnedMeshRenderer smr = meshlist[i] as SkinnedMeshRenderer;
             if (lod > 0f)
             {
                 LODMaker.MakeLODMesh(original, smr, lod);
             }
             else
             {
                 smr.sharedMesh = original;
             }
         }
         else
         {
             MeshFilter mf = meshlist[i] as MeshFilter;
             if (lod > 0f)
             {
                 LODMaker.MakeLODMesh(original, mf, lod);
             }
             else
             {
                 mf.sharedMesh = original;
             }
         }
     }
 }
예제 #2
0
 public static Mesh MakeLODMesh(Mesh orig, float aMaxWeight, bool recalcNormals, [Optional, DefaultParameterValue(1f)] float removeSmallParts, [Optional, DefaultParameterValue(1f)] float protectNormals, [Optional, DefaultParameterValue(1f)] float protectUvs, [Optional, DefaultParameterValue(1f)] float protectSubMeshesAndSharpEdges, [Optional, DefaultParameterValue(1f)] float smallTrianglesFirst)
 {
     return(LODMaker.MakeLODMesh(orig, aMaxWeight, removeSmallParts, protectNormals, protectUvs, protectSubMeshesAndSharpEdges, smallTrianglesFirst, recalcNormals, false));
 }
예제 #3
0
 public static Mesh MakeLODMesh(this Mesh orig, float aMaxWeight, bool recalcNormals, float removeSmallParts = 1f, float protectNormals = 1f, float protectUvs = 1f, float protectSubMeshesAndSharpEdges = 1f, float smallTrianglesFirst = 1f)
 {
     return(LODMaker.MakeLODMesh(orig, aMaxWeight, removeSmallParts, protectNormals, protectUvs, protectSubMeshesAndSharpEdges, smallTrianglesFirst, recalcNormals));
 }