🌎Scene Setup
Prepares scene on load before other user scripts Awake called.
All scenes after _Loader must have script that inherited from SceneLifetimeScope.cs. It's object located on top of all objects in premade scenes in hierarchy (GameplayScope and MenuScope).
It's important to inherite from SceneLifetimeScope.cs in your custom LifetimeScope and call base.Configure(builder); in Configure method:
public class GameplayLifetimeScope : SceneLifetimeScope {
// execution order (lifetime scope is earlier then all other scripts)
// inside lifetime scope execution: Configure is first, then Awake, OnEnable and Start
protected override void Configure(IContainerBuilder builder) {
base.Configure(builder); // this important line
// register your systems here
}
}Then you can register other systems in your scene It's important to add SceneUIContainer.cs (SceneUI object) that will activate UICanvasController, because LifetimeScope depends on it. Under SceneUI object replace all your UICanvasController prefabs. In Hierarchy it looks like this:

In scene hierarchy we replace it on top of other scenes:

Last updated