MultiSceneManager.cs

CarterGames.MultiScene.Runtime
CarterGames.Experimental.MultiScene

The multi scene manager is the main class to handle scene management with this asset. You should use this instead of the normal SceneManager when it comes to loading scenes & checking if scenes are active.

Properties

SceneGroup โ†’ Get

Gets the currently active scene group. This will update to whichever group is the latest loaded at runtime.

var group = MultiSceneManager.ActiveSceneGroup;

Events

void โ†’ Event

An event that raises just before the system loads a scene group.

MultiSceneManager.BeforeScenesLoaded.Add(MyMethod);

private void MyMethod()
{
.....

void โ†’ Event

An event that raises after the system had loaded a scene group & all interfaces have been called.

MultiSceneManager.PostScenesLoaded.Add(MyMethod);

private void MyMethod()
{
.....

string โ†’ Event

An event that raises after the system has loaded any scene, it passes through the name of the scene loaded as a param.

MultiSceneManager.OnSceneLoaded.Add(MyMethod);

private void MyMethod(string sceneName)
{
.....

string โ†’ Event

An event that raises after the system has unloaded any scene, it passes through the name of the scene unloaded as a param.

MultiSceneManager.OnSceneUnloaded.Add(MyMethod);

private void MyMethod(string sceneName)
{
.....

void โ†’ Event

An event that raises after the system has loaded a scene group, this event doesnโ€™t pass through the scene group as a param. Use OnSceneGroupLoadedWithCtx for a passthrough.

MultiSceneManager.OnSceneGroupLoaded.Add(MyMethod);

private void MyMethod()
{
.....

SceneGroupโ†’ Event

An event that raises after the system has loaded a scene group, it passes the group loaded as a param.

MultiSceneManager.OnSceneGroupLoadedWithCtx.Add(MyMethod);

private void MyMethod(SceneGroup group)
{
.....

Methods

Method
string โ†’ The scene name to search for.

Returns
bool โ†’ Whether or not the scene is in the group.

A helper method to get whether or not a scene is in the currently loaded scene group.

private void MyMethod()
{
    if (MultiSceneManager.IsSceneInGroup("MyScene")
    {
        // Logic here...
    }
}

Method
SceneGroup โ†’ The scene group to search through.

Returns
bool โ†’ Whether or not the scene is in the group.

A helper method to get whether or not a scene is in the group entered.

SceneGroup group;

private void MyMethod()
{
    if (MultiSceneManager.IsSceneInGroup(group, "MyScene")
    {
        // Logic here...
    }
}

Method
string โ†’ The scene name to

Returns
bool โ†’ Whether or not the scene is in the group.

A helper method to get whether or not a scene is in the currently loaded.

private void MyMethod()
{
    if (MultiSceneManager.IsSceneLoaded("MyScene")
    {
        // Logic here...
    }
}

Method
SceneGroup โ†’ The scene group to load.

A helper method to sets the active group to the group entered.

private void MyMethod()
{
    if (MultiSceneManager.IsSceneLoaded("MyScene")
    {
       // Logic here...
    }
}

Method
bool โ†’ Optional โ†’ Should the system reload scenes that are already loaded? Default: true

Loads the scene group currently set in the manager.

private void MyMethod()
{
    MultiSceneManager.LoadScenes();
}

Method
SceneGroup โ†’ The scene group to load.
bool โ†’ Optional โ†’ Should the system reload scenes that are already loaded? Default: true

Loads the scene group entered and sets it as the new active scene group.

SceneGroup group;

private void MyMethod()
{
    MultiSceneManager.LoadScenes(group);
}

Method
void

Reloads the current active scene group.

SceneGroup group;

private void MyMethod()
{
    MultiSceneManager.ReloadScenes();
}

Method
void

Unloads all the scenes currently loaded & loads a blank placeholder scene.

private void MyMethod()
{
    MultiSceneManager.UnloadAllActiveScenes();
}

Method
void

Unloads all the additive scenes currently loaded, but leaves the active (base) scene still running.

private void MyMethod()
{
    MultiSceneManager.UnloadAllAdditiveScenes();
}