C# Class Tools.TownGenerator.TownBuilder

Uses the city data to create a city on a terrain
Afficher le fichier Open project: TobieD/City-Generator Class Usage Examples

Méthodes publiques

Méthode Description
Build ( ) : void

Build a town on the terrain using the data provided

Clear ( ) : void
Initialize ( Terrain terrain, CityData cityData, TerrainSettings terrainSettings, GameObject townParent, Dictionary prefabs ) : void

Initialize with required data

Private Methods

Méthode Description
ChangeTerrainTexture ( Vector3 worldPos, int texture, int width, bool draw = true ) : void

Change the alpha map data to the specified texture at the positon in world coordinates

ChangeTerrainTexture ( int x, int z, int texture, int width, bool draw = true ) : void

Change the alpha map data to the texture at the map index [z,x]

DrawRoad ( Road road ) : void

traverse a road line and draw the road texture on the terrain

GenerateBuildingsOnRoad ( Road road ) : void

Generate Buildings on the edges of the road

GenerateObjectsInCell ( DistrictCell cell ) : void

Generate some additional gameobjects to the inside of a cell

GetAlphaMap ( ) : void

Store Alpha map data from the terrain

GetDetailMaps ( ) : void

Store Detail map data from the terrain

GetPrefabsForType ( string type ) : List

Access the user defined prefabs for this district type

InitializeStorage ( ) : void

Create or clear city data storage

RemoveDetailsAroundGameObject ( GameObject gameObject ) : void

Removes details spawned around the gameobject

SetAlphaMap ( ) : void

Update alpha map of the terrain

SetDetailMaps ( ) : void

Update detail map of the terrain

SpawnBuilding ( Vector3 position, GameObject prefab, BuildingSite building ) : void

Spawn a building on the position

SpawnProp ( Vector3 position ) : void

Spawn a random prop on the terrain

SpawnTree ( Vector3 position ) : void

Spawn a random tree on the terrain

SplitCityData ( ) : void

split up the data from the city in seperate list to allow for easier access

isOverlapping ( GameObject prefab, Vector3 pos ) : bool

Method Details

Build() public méthode

Build a town on the terrain using the data provided
public Build ( ) : void
Résultat void

Clear() public méthode

public Clear ( ) : void
Résultat void

Initialize() public méthode

Initialize with required data
public Initialize ( Terrain terrain, CityData cityData, TerrainSettings terrainSettings, GameObject townParent, Dictionary prefabs ) : void
terrain UnityEngine.Terrain
cityData CityGenerator.CityData
terrainSettings TerrainSettings
townParent UnityEngine.GameObject
prefabs Dictionary
Résultat void