コード例 #1
0
 public TerrainChunk(TERRAIN.ETerrain _terrain, Vector3 _center, Vector2 _size, HexTileMapGenerator_V2 _mapGenerator)
 {
     terrain      = _terrain;
     terrainData  = TerrainData.GetTerrainData(_terrain);
     center       = _center;
     size         = _size;
     mapGenerator = _mapGenerator;
 }
コード例 #2
0
    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();
    }
コード例 #3
0
 public static TerrainData GetTerrainData(TERRAIN.ETerrain _eTerrain)
 {
     return(GetTerrainMap()[_eTerrain]);
 }