public void ApplyChunk(Age.TerrainChunk chunk) { this.tc = chunk; this.SetHeights(chunk); this.SetTextures(chunk); this.td.RefreshPrototypes(); this.GetComponent<Terrain>().Flush(); }
public void Start() { this.tc = new Age.TerrainChunk(512, 512); this.td = this.GetComponent<Terrain>().terrainData; this.SetHeights(this.tc); }
public static Age.TerrainChunk GenerateTerrain(Word[] words) { Random.seed = 25; Age.TerrainChunk map = new Age.TerrainChunk(512, 512); map.FillTexture(Age.DIRT); Phrase[] phrases = GetPhrases(words); // Lil hack to make bad first noun choices more interesting if (phrases.Length == 1 && !(phrases[0].feature is IslandWord)) { Phrase islandPhrase = new Phrase(); islandPhrase.feature = new IslandWord(); islandPhrase.location = phrases[0].location; ApplyPhrase(map, islandPhrase); } foreach (Phrase phrase in phrases) { ApplyPhrase(map, phrase); } return map; }