> For the complete documentation index, see [llms.txt](https://reflective-roommanager.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reflective-roommanager.gitbook.io/docs/user-manual/scene-management/processor/additive-scene-processor.md).

# Additive Scene Processor

This class provides a basic structure that handles loading and unloading of additional scenes. `AdditiveSceneProcessor` extends the `SceneProcessor` class.

### Members

* `private readonly Queue<SceneLoadingTask> _scenes = new()`:&#x20;
  * A queue used to sort scenes to load.
* `private readonly List<Scene> LoadedScenes = new()`:&#x20;
  * A list that keeps track of the scenes that have been uploaded.

### Constructure

* ```csharp
  public AdditiveSceneProcessor()
  ```
  * The constructor method sets the loading mode to `LoadSceneMode.Additive` and defines event listeners.

### **Methods**

1. ```csharp
   public override void LoadScene(string sceneName, Action<Scene> onCompleted = null)
   ```
   * **Parameteres:**
     * `sceneName`: The name of the scene to load.
     * `onCompleted`: The action that will be called when the installation process is completed (defaults to null).
   * It adds it to the `_scenes` queue containing the settings for the loading process and then starts the loading process in the base class (`SceneProcessor`).
2. ```csharp
   public override void UnLoadScene(Scene scene, Action<Scene> onCompleted = null)
   ```
   * **Paramteres:**
     * `scene`: Boşaltılacak olan sahne.
     * `onCompleted`: Boşaltma işlemi tamamlandığında çağrılacak olan aksiyon (varsayılan değeri null'dir).
   * Boşaltma işleminin ayarlarını içeren `_scenes` kuyruğuna ekler ve ardından temel sınıfa (`SceneProcessor`) boşaltma işlemini başlatır.
3. ```csharp
   public override IEnumerator Process()
   ```
   * The method that initializes the processor. Processes each scene waiting in the `_scenes` queue.
   * It updates the loading status and ensures that operations are carried out sequentially.
   * It makes the necessary adjustments for loading and unloading operations and initiates asynchronous operations.
   * When the transaction is completed, the specified action is called and the transaction status is updated.
4. ```csharp
   private void KeepLoadedScene(Scene scene)
   ```
   * **Parameteres:**
     * `scene`: The loaded scene.
   * Adds loaded scenes to the `LoadedScenes` list.
5. ```csharp
   private void DiscardLoadedScene(Scene scene)
   ```
   * **Parameteres:**
     * `scene`: The unloaded scene.
   * Removes unloaded scenes from the `LoadedScenes` list.

This class provides a basic structure that handles loading and unloading of additional scenes.
