# Load Biome Settings

## **Opening the Window**

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

<figure><img src="https://1503389242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmAcFth2IS05hBefll31s%2Fuploads%2FSXZvcUMvtoADnhMaWSGX%2Fimage.png?alt=media&#x26;token=05a4b0d7-ebc0-45d8-b515-6f5463f79b34" alt=""><figcaption></figcaption></figure>

***

## **Interface Overview**

<figure><img src="https://1503389242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmAcFth2IS05hBefll31s%2Fuploads%2F9BwPDMWHWsF06OZ9gAFu%2Fimage.png?alt=media&#x26;token=67e8ad21-216b-4af6-a1d2-867479119844" alt=""><figcaption></figcaption></figure>

The interface includes fields and buttons for selecting the terrain generator and biome settings:

* **Terrain Generator**
  * **Type:** Object Field
  * **Description:** Assign the `TerraForge Terrain Generator` to which the biome settings will be applied. Drag and drop the component from your scene into this field.
* **Biome Settings**
  * **Type:** Object Field
  * **Description:** Assign the `Biome Settings` file from which the settings will be loaded. Drag and drop the saved Biome Settings asset into this field.
* **Load and Apply Biome Settings**
  * **Type:** Button
  * **Description:** Click this button to load the biome settings from the specified file and apply them to the selected terrain generator.

***

## **How to Use**

1. **Assign the Terrain Generator**\
   Drag and drop the `TerraForge Terrain Generator` component into the Terrain Generator field.
2. **Assign the Biome Settings File**\
   Drag and drop the Biome Settings asset into the Biome Settings field.
3. **Load and Apply Settings**\
   Click the Load and Apply Biome Settings button. This will transfer the settings from the file to the terrain generator, updating its configuration.

***

## Quick Script Overview

* **`ShowWindow()`:** Opens the `Load Biome Settings` window via the Unity menu.
* **`OnGUI()`:** Renders the interface for selecting the terrain generator and biome settings. Includes a button for loading and applying the settings.
* **`LoadAndApplyBiomeSettings()`:** Handles loading settings from the `Biome Settings` file and applying them to the `TerraForge Terrain Generator`. It updates terrain height, terrain layers, and hydraulic erosion layer settings. Displays error dialogs if either field is not assigned, and a success dialog upon successful application.

***

## **Additional Notes**

* **Error Handling:** If either the `Terrain Generator` or `Biome Settings` file is not assigned, an error dialog will prompt you to provide the necessary information.
* **Success Confirmation:** A confirmation dialog appears upon successful application of the settings, indicating that the biome settings have been applied correctly.
