示例#1
0
        private static ChunkGO Get(Chunk chunk)
        {
            var go = new GameObject();
            var chunkGo = go.AddComponent<ChunkGO>();
            chunkGo._filter = go.AddComponent<MeshFilter>();
            chunkGo._renderer = go.AddComponent<MeshRenderer>();
            chunkGo._renderer.reflectionProbeUsage = ReflectionProbeUsage.Off;
            chunkGo._renderer.useLightProbes = false;
            go.name = chunk.Position.X + " : " + chunk.Position.Z;
            _allChunksGO.Add(chunkGo);

            var minCorner = Chunk.GetBounds(chunk.Position).Min;
            chunkGo.transform.position = new Vector3(minCorner.X, 0, minCorner.Z);

            return chunkGo;
        }
示例#2
0
 public static ChunkGO Create(Chunk chunk, TextureMesher.ChunkModel model)
 {
     var chunkGo = Get(chunk);
     chunkGo.Init(model);
     return chunkGo;
 }