public void SetResolution(TerrainResolution terrainResolution) { chunkTerrain.terrainData.heightmapResolution = terrainResolution.heightMapResolution; chunkTerrain.terrainData.size = new Vector3(terrainResolution.terrainSize, terrainResolution.terrainHeight, terrainResolution.terrainSize); chunkTerrain.terrainData.SetDetailResolution(terrainResolution.detailResolution, terrainResolution.resolutionPerPatch); chunkTerrain.detailObjectDensity = terrainResolution.detailObjectDensity; chunkTerrain.detailObjectDistance = terrainResolution.detailObjectDistance; }
void Awake() { if (Application.isPlaying) { return; } worldInstance = this; ResourceLoader.LoadResources(); BiomeManager.FillBiomeList(); TerrainName = TerrainObjectName; terrainResolution = new TerrainResolution(); nameScene = UnityEditor.EditorApplication.currentScene.Substring(UnityEditor.EditorApplication.currentScene.LastIndexOf("/") + 1); nameScene = nameScene.Substring(0, nameScene.IndexOf(".")); Load(Paths.SavedWorlds + nameScene + ".data"); }
public TERRAIN_DATA(TerrainResolution _resolution, int gridsX, int gridsY) { resolution = _resolution; nGridsX = gridsX; nGridsY = gridsY; }