TERRAFORGE Documentation
  • WELCOME!
    • πŸ‘‹Hello!
    • 🏷️Supported Unity Versions & RPs
    • πŸ—ΊοΈRoadmap
    • πŸ–οΈChangelogs
    • 😎Support & Community
    • πŸ‘½FAQs
  • GETTING STARTED
    • πŸ”ŒInstallation & Setup
    • πŸŽ–οΈCreating New Terrains with TerraForge 2
    • β›΅Demos & Samples
  • HOW IT WORKS
    • 🧾Documentation & Code
    • πŸ—»Terrain Generator
    • ⛰️Terrains Grid Generator
    • πŸŒ‹Biomes Settings
    • 🏝️Terrain Painter
    • πŸ˜‡TerraForge Helper
    • βš™οΈGlobal Settings
    • πŸ“₯Save Biome Settings
    • πŸ“‡Load Biome Settings
    • πŸ’ͺRuntime Scripting API
Powered by GitBook
On this page
  • Opening the Window
  • Interface Overview
  • How to Use
  • Quick Script Overview
  • Additional Notes
  1. HOW IT WORKS

Save Biome Settings

The Save Biome Settings menu allows you to save the current settings of a biome generated by the TerraForge Terrain Generator.

PreviousGlobal SettingsNextLoad Biome Settings

Last updated 10 months ago

Opening the Window

To open the Save Biome Settings window, navigate to: Tools > TerraForge 2 > Save Biome Settings in the Unity Editor menu bar.


Interface Overview

The interface consists of several fields and buttons to configure and save your biome settings:

  1. 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.

  2. File Name

    • Type: Text Field

    • Description: The name of the file to save the biome settings. By default, it's set to BiomeSettings.asset.

  3. 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.

  4. 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.


How to Use

  1. Assign the Terrain Generator

    • Drag and drop the TerraForge Terrain Generator component from your scene or project into the Terrain Generator field.

  2. Set the File Name

    • Enter the desired name for your settings file in the File Name field. The default name is BiomeSettings.asset.

  3. 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/.

  4. 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.


Quick Script Overview

  • 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.


Additional Notes

  • 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.

πŸ“₯