Ver código fonte

Added setting to change the generated terrain GameObject layer

James Peret 2 anos atrás
pai
commit
b3c5435c86
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      Runtime/MarchingCubes4.cs

+ 2 - 0
Runtime/MarchingCubes4.cs

@@ -19,6 +19,7 @@ namespace KairoEngine.TerrainEngine
         public bool flatShaded;
         public Material material;
         public GameObject parent;
+        [Layer] public int terrainLayer;
         
 
         private MeshFilter meshFilter;
@@ -137,6 +138,7 @@ namespace KairoEngine.TerrainEngine
             mesh.RecalculateNormals();
             meshFilter.mesh = mesh;
             meshCollider.sharedMesh = mesh;
+            target.layer = terrainLayer;
         }
 
         private void ScheduleJob(Vector3 initialPosition)