> ## Documentation Index
> Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
> Use this file to discover all available pages before exploring further.

# SceneLoadManager

> Scene loading queue, Addressable scene management, and scene state tracking.

**Namespace:** `Molca`\
**Interface:** `ISceneLoader`\
**File:** `Packages/com.molca.core/Runtime/Runtime/SceneLoadManager.cs`\
**Type:** `RuntimeSubsystem` (child of [RuntimeManager](/core/runtime-manager) prefab)

## When to use

Use `SceneLoadManager` for scene transitions that need queuing, Addressables integration, event dispatch, and progress tracking. For simple one-off scene loads, the built-in `SceneManager` works; this adds a load queue, typed events, and addressable scene lifecycle management.

> ⚠️ The static API (`SceneLoadManager.LoadScene`, etc.) is deprecated. Use the `ISceneLoader` instance interface.

## Role

* **Queued loading** — scenes are enqueued and processed sequentially. Only one load at a time.
* **Addressable scenes** — loads/unloads scenes through Addressables with handle tracking, so unloads properly release memory.
* **Events** — dispatches `TypedEvents.SceneLoadStarted`, `SceneLoadCompleted`, `SceneLoadFailed`, `SceneUnloadStarted`, `SceneUnloadCompleted` through [EventDispatcher](/core/event-dispatcher).
* **Single-mode cleanup** — before loading a Single-mode scene, all Addressable scenes are automatically unloaded to prevent memory leaks.

## API Reference

### ISceneLoader (recommended)

Resolve via `RuntimeManager.GetService<ISceneLoader>()` or `[Inject] ISceneLoader`.

| Method                       | Signature                                                                                                 | Description                                                         |
| ---------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `ActiveScene`                | `Scene ActiveScene { get; }`                                                                              | The currently active scene.                                         |
| `LoadScene`                  | `void LoadScene(string sceneName, LoadSceneMode mode, Action<Scene> onComplete = null)`                   | Queue a scene load by name.                                         |
| `LoadAddressableScene`       | `bool LoadAddressableScene(AssetReference sceneRef, LoadSceneMode mode, Action<Scene> onComplete = null)` | Queue an Addressable scene load. Returns false if not in play mode. |
| `LoadNextScene`              | `void LoadNextScene(LoadSceneMode mode, Action<Scene> onComplete = null)`                                 | Load the next scene by build index.                                 |
| `UnloadScene`                | `Awaitable UnloadScene(string sceneName)`                                                                 | Unload a scene (handles Addressable and non-Addressable).           |
| `UnloadAllAddressableScenes` | `Awaitable UnloadAllAddressableScenes()`                                                                  | Unload every Addressable scene loaded through this manager.         |
| `TryGetNextSceneName`        | `bool TryGetNextSceneName(out string sceneName)`                                                          | Get the next scene name from build settings.                        |
| `IsSceneLoaded`              | `bool IsSceneLoaded(string sceneName)`                                                                    | Check if a scene is currently loaded.                               |

## Code

```csharp theme={null}
using Molca;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneTransitioner : MonoBehaviour
{
    [Inject] private ISceneLoader _sceneLoader;

    private async void Start()
    {
        await RuntimeManager.WaitForInitialization();
    }

    public void GoToGameScene()
    {
        _sceneLoader.LoadScene("GameScene", LoadSceneMode.Single, scene =>
        {
            Debug.Log($"Loaded: {scene.name}");
        });
    }
}
```

## Events

Dispatched via `EventDispatcher`:

| Event                  | Data                      | When                        |
| ---------------------- | ------------------------- | --------------------------- |
| `SceneLoadStarted`     | `SceneLoadEventData`      | A scene load is queued.     |
| `SceneLoadCompleted`   | `SceneLoadEventData`      | Scene has finished loading. |
| `SceneLoadFailed`      | `SceneLoadErrorEventData` | Scene load failed.          |
| `SceneUnloadStarted`   | `string sceneName`        | Scene unload begins.        |
| `SceneUnloadCompleted` | `string sceneName`        | Scene has been unloaded.    |

## Related

* [RuntimeManager](/core/runtime-manager) — `SceneLoadManager` is a child subsystem
* [EventDispatcher](/core/event-dispatcher) — scene load/unload events dispatched here
