C# 클래스 Tools.TownGenerator.TownBuilder

Uses the city data to create a city on a terrain
파일 보기 프로젝트 열기: TobieD/City-Generator 1 사용 예제들

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

Build() 공개 메소드

Build a town on the terrain using the data provided
public Build ( ) : void
리턴 void

Clear() 공개 메소드

public Clear ( ) : void
리턴 void

Initialize() 공개 메소드

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
리턴 void