π₯Save Biome Settings
The Save Biome Settings menu allows you to save the current settings of a biome generated by the TerraForge Terrain Generator.
Last updated
The Save Biome Settings menu allows you to save the current settings of a biome generated by the TerraForge Terrain Generator.
Last updated
To open the Save Biome Settings
window, navigate to: Tools > TerraForge 2 > Save Biome Settings
in the Unity Editor menu bar.
The interface consists of several fields and buttons to configure and save your biome settings:
Terrain Generator
Type: Object Field
Description: This field allows you to assign the TerraForge Terrain Generator
from which the biome settings will be saved. You can drag and drop the TerraForge Terrain Generator
component from your scene or project into this field.
File Name
Type: Text Field
Description: The name of the file to save the biome settings. By default, it's set to BiomeSettings.asset
.
Save Folder
Type: Folder Selection
Description: This field shows the folder path where the settings will be saved. You can change the save location by clicking the Select Folder
button.
Save Biome Settings
Type: Button
Description: Clicking this button saves the biome settings from the assigned terrain generator to a file in the specified folder.
Assign the Terrain Generator
Drag and drop the TerraForge Terrain Generator
component from your scene or project into the Terrain Generator
field.
Set the File Name
Enter the desired name for your settings file in the File Name
field. The default name is BiomeSettings.asset
.
Select the Save Folder
Click the Select Folder
button to choose a folder where the settings file will be saved. The default path is Assets/TerraForge 2/Demo/Profiles/Biome Settings Profiles/
.
Save the Settings
Once all fields are set, click the Save Biome Settings
button. If a file with the same name already exists, you'll be prompted to confirm if you want to overwrite it.
ShowWindow()
: Opens the Save Biome Settings window through the Unity menu.
OnEnable()
: Loads the last used save folder path.
OnDisable()
: Stores the current save folder path for future use.
OnGUI()
: Displays the editor interface for selecting the terrain generator, specifying the file name, and choosing the save location. It includes buttons for selecting the folder and saving the settings.
SaveBiomeSettings()
: Handles the process of saving the biome settings. It creates a BiomeSettings
asset using data from the terrain generator, checks for existing files, and saves the asset to the specified directory. If the folder does not exist, it creates it.
File Overwrite Confirmation: If the specified file name already exists in the save folder, you'll be prompted to confirm whether you want to overwrite the existing file.
Automatic Directory Creation: If the specified save folder does not exist, it will be created automatically.