# Global Settings

## **Opening the Window**

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

<figure><img src="/files/NTPCAXp6grdRot9llER8" alt=""><figcaption></figcaption></figure>

***

## **Interface Overview**

<figure><img src="/files/VZSnLFzY3rmOv24ho4es" alt=""><figcaption></figcaption></figure>

The window is divided into sections, each managing different aspects of the global settings:

1. **Editor GUI Settings**
   * **Enable Caution and Confirmation Windows**
     * **Type:** Toggle
     * **Description:** Toggle this option to enable or disable caution and confirmation dialogs within the editor.
2. **Generation Settings**
   * **Delay Between Automatic Generating Operations**
     * **Type:** Slider
     * **Range:** 100 to 1000
     * **Description:** Adjust the delay between automatic generation operations to manage performance and responsiveness.
   * **Path to Save TerrainData in the Editor**
     * **Type:** Text Field
     * **Description:** Define the path where terrainData will be saved in the editor.
3. **Object References**
   * **Default Terrain**
     * **Type:** Object Field
     * **Description:** Assign the default TerraForge terrain prefab.
   * **Default Terrain For Grid**
     * **Type:** Object Field
     * **Description:** Assign the default TerraForge terrain prefab for grid generation.
   * **Biome Preview Terrain**
     * **Type:** Object Field
     * **Description:** Assign the prefab used for biome previews.
   * **Default Terrain Grid**
     * **Type:** Object Field
     * **Description:** Assign the default terrain grid prefab.
   * **Default TerrainData**
     * **Type:** Object Field
     * **Description:** Assign the default TerraForge terrain data.
   * **Biome Preview TerrainData**
     * **Type:** Object Field
     * **Description:** Assign the terrain data for biome previews.
   * **Hydraulic Erosion ComputeShader**
     * **Type:** Object Field
     * **Description:** Assign the compute shader used for hydraulic erosion.
4. **Auto Assign Objects**
   * **Type:** Button
   * **Description:** Automatically finds and assigns default assets for the settings.

***

## **How to Use**

1. **Adjust Settings**
   * Configure editor GUI settings and generation delays.
   * Assign the necessary GameObject and TerrainData references.
2. **Auto Assign Assets**
   * Click the **Auto Assign Objects** button to automatically load and assign default assets from the Resources folder.
3. **Save Changes**
   * Changes are automatically saved, but you can force save by clicking outside the editor window or making additional changes.

***

## Quick Script Overview

* **TerraForgeGlobalSettings.cs**
  * **Purpose:** Defines the global settings used by TerraForge and provides a singleton instance for accessing these settings.
  * **Key Properties:** Includes settings for confirmation dialogs, delays, prefabs, and shaders.
  * **Methods:** Provides a singleton access point and a method for reloading the settings.
* **TerraForgeSettingsWindow\.cs**
  * **Purpose:** Implements the editor window for managing global settings.

***

## **Additional Notes**

* **Automatic Assignment:** The Auto Assign feature helps to quickly set up your global settings by loading assets from the Resources folder, ensuring that all necessary references are correctly assigned.
* **Resource Management:** Ensure that all referenced assets are correctly placed in the Resources folder to avoid missing references.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiskered.gitbook.io/terraforge-documentation/how-it-works/global-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
