# Scene Setup

All scenes after <mark style="color:green;">**\_Loader**</mark> 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).

{% hint style="danger" %}
It's <mark style="color:$danger;">**important**</mark> to inherite from SceneLifetimeScope.cs in your custom LifetimeScope and call base.Configure(builder); in Configure method:

```csharp
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 <mark style="color:$danger;">**important**</mark> 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:

<img src="https://1613353771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fygjewtla1W7kzTTIpGWq%2Fuploads%2Finh9h5DHijKv5aqopjBy%2Fimage.png?alt=media&#x26;token=2d593393-3176-4ed8-b12b-1935061273c6" alt="" data-size="original">
{% endhint %}

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

&#x20;![](https://1613353771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fygjewtla1W7kzTTIpGWq%2Fuploads%2Fflh0VkmYKozcwgAhLKGk%2Fimage.png?alt=media\&token=24edff8b-2ea1-49a3-82da-6e3de29695ba)
