C# Class Tools.TownGenerator.TerrainTileGenerator

Generates terrain using tiles the center tile should always be the tile the town gets build on
ファイルを表示 Open project: TobieD/City-Generator Class Usage Examples

Public Properties

Property Type Description
CityTerrain UnityEngine.Terrain
Generated bool

Public Methods

Method Description
BuildTerrain ( ) : void

Creates the terrain and applies the height map and alpha map

Clear ( ) : void
InitializeSettings ( TerrainSettings terrainSettings, GenerationSettings voronoiSettings, GameObject parent, CitySettings citySettings ) : void

set required data for generating the terrain

Private Methods

Method Description
AddLake ( Terrain terrain, int tileX, int tileZ, int lakeSize = 150 ) : void

Add a lake to the terrain

CreatePrototypes ( ) : void

Create splatmaps, trees and detail prototypes

CreateTerrainTile ( int x, int z ) : Terrain

Create terrain for the given tile

FindCityTerrainTile ( ) : Terrain

Find the ideal position for the city to be spawned on

FixTerrainSeams ( ) : void

Fix seams between tiles by correctly setting the neighbours

GenerateAlphaMap ( TerrainData data ) : float[,,]

Generate textures for the terrain

GenerateDetailLayers ( TerrainData data, int tileX, int tileZ ) : ]>.List

Generate detail like grass and props on the terrain

GenerateHeightMap ( int tileX, int tileZ ) : ].float[

Generate height information for the terrain at the given tile

GenerateTrees ( TerrainData data, int tileX, int tileZ ) : List

Generate trees on the terrain

Method Details

BuildTerrain() public method

Creates the terrain and applies the height map and alpha map
public BuildTerrain ( ) : void
return void

Clear() public method

public Clear ( ) : void
return void

InitializeSettings() public method

set required data for generating the terrain
public InitializeSettings ( TerrainSettings terrainSettings, GenerationSettings voronoiSettings, GameObject parent, CitySettings citySettings ) : void
terrainSettings TerrainSettings
voronoiSettings Voronoi.GenerationSettings
parent UnityEngine.GameObject
citySettings CityGenerator.CitySettings
return void

Property Details

CityTerrain public_oe property

Terrain the city will be created on
public Terrain,UnityEngine CityTerrain
return UnityEngine.Terrain

Generated public_oe property

public bool Generated
return bool