// Use this for initialization void Start() { terrain = FindObjectOfType <DomainWarpingFBMTest>(); lastingTime = terrain.width * terrain.animateSpeed; if (terrain.animate) { Destroy(gameObject, lastingTime); } }
float[,] heights; //get all the height points for the terrain... this will be where ware are going paint our textures on // Use this for initialization void Start() { terrain = this.gameObject.GetComponent <Terrain>(); //create a neat reference to our terrain terrainData = terrain.terrainData; //create a neat reference to our terrain data proceduralTerrain = FindObjectOfType <DomainWarpingFBMTest>(); //alphaMapResolution = terrainData.alphamapResolution; alphaMapHeight = terrainData.heightmapHeight; alphaMapWidth = terrainData.heightmapWidth; if (!proceduralTerrain.animate) { CreateOnce(); } }