This plugin allow you to create levels using multiple scenes to optimize your workflow and your application.
This plugin should be cloned into your Unity project to access new updates. It's highly recommended to use git submodules : https://git-scm.com/book/en/v2/Git-Tools-Submodules
- Method 1 (Recommended) : Create a folder "Enhanced Scene Manager" into your Asset folder and clone the project into it from new repository or git submodule.
- Method 2 : Download the project .zip file and unpack it directly in your Asset folder.
Once the addon is imported in your project, two new types of assets appeared in your create panel.
Scene Bundle
: This asset is a group of scenes you want to load simultaneaously.Scene Bundle List
: The equivalent of build setting scene. Group everyScene Bundle
you want to use and build in your application. Contains also a Persistant Scene Bundle that will be loaded only once and persist while application is running.
To setup this, go to "Window/Enhanced Scene Manager" to deploy the Enhanced Scene Manager window.
By default the window suggest you to create a new Scene Bundle List
. Create a new one. You also can create a new Scene Bundle List
from "Create/Enhanced Scene Manager/Scene Bundle List".
Once your Scene Bundle List
is ready, you can fill it with Scene Bundles
, refer a Persistant Scene Bundle if your application architecture requires it.
The first bundle in the Scene Bundles List will be the first loaded in the application !.
(tip : Lock the inspector, select the Scene Bundles
and click + button to directly refer selected Scenes Bundles).
To create a new Scene Bundle
, go to "Create/Enhanced Scene Manager/Scene Bundle".
In this one, refer all the Scene Assets
you want to load into it .
(tip : Lock the inspector, select the Scene Assets
and click + button to directly refer selected Scenes).
Register your bundles in your current Scene Bundle List
to add it to the build setting and load/access it from the Enhanced Scene Manager Window.
Deploy it from "Window/Enhanced Scene Manager".
On Enhanced Scene Manager, select Scene Bundle
to load it and select A to select his asset.
You also can set the current used Scene Bundle List (Note : For example you can have multiple Scene Bundle list if you want to build levels separately for prototyping or debug for example).
Loading a scene bundle is pretty easy. You just need a Scene Bundle reference and call the Load() method from it.
public void Load();
using UnityEngine;
using SorangonToolset.EnhancedSceneManager;
public class LevelLoader : MonoBehaviour{
[SerializeField] private SceneBundle levelToLoad = null;
public void OnGUI(){
if(GUILayout.Button("LoadLevel")){
//Just call the Load() method from Scene Bundle
levelToLoad.Load();
}
}
}
You also can call LoadAsync().This is recommended to use more often than Load().
public void LoadAsync();
You can call those methods from a Unity Event
.
! The level you want to load must be registered in the Current Scene List !
- Manage your application with Persistant Scene Bundle.
The Persistant Scene Bundle can manage the core logic of your application. Use those scenes to setup your game manager, loading screens, runtime debugging tools and much more !
- Separate your datas to make teamwork easier.
For example, for a level you can make a logic scene that manage the logic and gameplay part and also make a graphic level on which you will create your level environment art. This allow you and your team to work simultaneously on the same level on his proper part without having merge problems.
- Reuse your scenes to reduce application weight.
For example, you want to create 2 levels in a same environment. With this system, you san separate the graphic part of the level in a scene and use 2 others one to manage different levels logic then reference the same graphic scene in two differents bundles.