예제 #1
0
        private void Start()
        {
            terrainObject = new GameObject("Terrain")
            {
                isStatic = true
            };

            config = GetComponent <TerrainConfig>();
            var blocksGenerator = GetComponent <TerrainBlocksGenerator>();

            chunksPool = GetComponent <TerrainChunksPool>();

            chunkGenerator = new TerrainChunkGenerator(blocksGenerator, chunksPool, config);

            modifier = GetComponent <TerrainModifier>();
            modifier.Setup(chunkGenerator, terrainObject.transform);

            UpdateTerrain()
            .ContinueWith(_ => Debug.Log("First load finished!"));
        }
 public TerrainChunkGenerator(TerrainBlocksGenerator blocksGenerator, TerrainChunksPool chunksPool, TerrainConfig config)
 {
     this.blocksGenerator = blocksGenerator;
     this.chunksPool      = chunksPool;
     this.config          = config;
 }