public void DebugUpdate() { var t = debugTerrain.GetComponent <Terrain>(); int hr = t.terrainData.heightmapResolution; float s = Time.realtimeSinceStartup; var res = GenerateTile(worldToTerrain(debugTerrain.transform.position, t), hr, hr, true); debugTerrain.SetTerrainData(res.heightmap, res.alphamap, debugTerrain.transform.position); Debug.LogFormat("Generated terrain in {0} seconds", Time.realtimeSinceStartup - s); }