Multi Scene Scripting API

✅ Assemblies


All the code in this asset is under assembly definitions. This helps with compile times for your code & keeps the asset code all neat & out of the way. If your code is also in an assembly definition you will need reference the assembly/assemblies to access the code for this asset. The assemblies are:

CarterGames.MultiScene.Runtime

CarterGames.MultiScene.Editor

For accessing the runtime code of the asset.

For accessing the editor code of the asset.


🚩 Namespaces


All code for this asset is under the following namespace(s), as this asset is still an experimental solution, the namespace reflects this state instead of following the normal Assets mid section.

// Editor Logic
CarterGames.Experimental.MultiScene.Editor

// Runtime Logic
CarterGames.Experimental.MultiScene

🎗️ Scripting


🎭 Events System


Multi scene uses a custom events system. This system is more or less just your standard action/delegate which you can subscribe/unsubscribe to. The main difference is an additional setup to avoid duplicate assignments to an action when adding a listener.

Event Subscribing


Subscribing to events is as easy as it is to do with actions. Instead of using += or -= to subscribe, the events system has 2 simple methods, being Add() & Remove()

Note that any method subscribing to an event will need to have the same number of parameters of the same type to subscribe correctly.

private void OnEnable()
{
		MultiSceneManager.BeforeScenesLoaded.Add(OnPreSceneLoad);
}

private void OnDisable()
{
		MultiSceneManager.BeforeScenesLoaded.Remove(OnPreSceneLoad);
}

private void OnPreSceneLoad()
{
		// Some logic here...
}

There are only 6 public events in the runtime space that you need to know about, all of which are mentioned in the MultiSceneManager.cs page.

ℹ️ Interface Listeners


#️⃣ Core Classes


⬆️ Extension Classes