SceneManager

A static service that provides scene loading, unloading, and query operations with automatic dependency resolution.

Definition

Namespace: Paragon.Core.SceneManagement Assembly: Paragon.dll

public class SceneManager

Events

SceneLoaded

Raised when a scene finishes loading.

public static event Action<Scene> SceneLoaded;

SceneUnloaded

Raised when a scene is unloaded.

public static event Action<Scene> SceneUnloaded;

Methods

LoadScene()

Loads a scene synchronously with optional dependency loading.

Parameter
Type
Description

scene

Scene

The scene to load

loadDependencies

bool

Whether to load dependencies first

loadSceneMode

LoadSceneMode

Single or additive loading

LoadSceneAsync()

Loads a scene asynchronously with optional dependency loading.

Parameter
Type
Description

scene

Scene

The scene to load

loadDependencies

bool

Whether to load dependencies first

loadSceneMode

LoadSceneMode

Single or additive loading

Returns: Task — Completes when all scenes finish loading

UnloadScene()

Unloads a scene asynchronously (fire-and-forget).

Parameter
Type
Description

scene

Scene

The scene to unload

unloadDependencies

bool

Whether to unload dependencies

UnloadSceneAsync()

Unloads a scene asynchronously with await support.

Parameter
Type
Description

scene

Scene

The scene to unload

unloadDependencies

bool

Whether to unload dependencies

Returns: Task — Completes when unloading finishes

GetActiveScene()

Returns the currently active scene.

Returns: Scene — The active scene

SetActiveScene()

Sets the active scene.

Parameter
Type
Description

scene

Scene

The scene to activate

GetLoadedScenes()

Returns all currently loaded scenes.

Returns: IEnumerable<Scene> — Loaded scenes from the graph

IsSceneLoaded()

Checks if a scene is currently loaded.

Parameter
Type
Description

scene

Scene

The scene to check

Returns: booltrue if loaded

TryGetScene()

Attempts to find a scene by name or path.

Parameter
Type
Description

sceneNameOrPath

string

Scene name or full path

scene

out Scene

The found scene

Returns: booltrue if found

GetScene()

Returns a scene by name or path.

Returns: Scene — The scene, or null if not found

GetUnityScene()

Converts a Scene to Unity's native scene struct.

Returns: UnityScene — The Unity scene struct

MoveGameObjectToScene()

Moves a GameObject to a specific scene.

MoveGameObjectToActiveScene()

Moves a GameObject to the currently active scene.

Example

See Also

Last updated

Was this helpful?