public TerrainChunk(TERRAIN.ETerrain _terrain, Vector3 _center, Vector2 _size, HexTileMapGenerator_V2 _mapGenerator) { terrain = _terrain; terrainData = TerrainData.GetTerrainData(_terrain); center = _center; size = _size; mapGenerator = _mapGenerator; }
private void InstantiateMap() { planetData = PlanetData.GetRandomPlanetData(); TERRAIN.ETerrain[,] terrain = new TERRAIN.ETerrain[terrainDimension, terrainDimension]; for (int i = 0; i < terrainDimension; i++) { for (int j = 0; j < terrainDimension; j++) { terrain[i, j] = TerrainData.GetRandomTerrainByFrequency(); } } mapObject = Instantiate(mapPrefab, new Vector3(), Quaternion.identity); map = mapObject.GetComponent <Map>(); map.InitMap(chunkTileCountX, chunkTileCountY, chunkTileCountZ, this); InstantiateChunks(terrain); map.MoveTo(currentCenter); waterLevel.transform.position = map.GetActualCenter(); }
public static TerrainData GetTerrainData(TERRAIN.ETerrain _eTerrain) { return(GetTerrainMap()[_eTerrain]); }