示例#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));
 }