瀏覽代碼

Added setting to change the generated terrain GameObject layer

James Peret 2 年之前
父節點
當前提交
b3c5435c86
共有 1 個文件被更改,包括 2 次插入0 次删除
  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)