You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `ParentOverrideScope` class allows you to temporarily override the default parent container for all containers created via `ContainerBuilder`. Once an instance of this scope is created, it remains active until explicitly disposed, during which time all newly built containers will inherit from the overridden parent instead of the default one.
219
-
This is particularly useful for instance when you want one scene to inherit services from another scene, enabling a more granular control over which parent container is used for each newly loaded scene.
220
-
220
+
### Override scene container parent
221
+
To do this or whatever else you want with scene `ContainerBuilder` you can access it with `SceneScope.OnSceneContainerBuilding` like we show in `Loader.cs` in "Getting Started" section.
221
222
```csharp
223
+
// here we take boot scene container just for an example, you can use any container you need
By utilizing this API, you can create hierarchical structures such as the one shown below:
239
247
@@ -287,35 +295,6 @@ using var scopedContainer = parentContainer.Scope(builder =>
287
295
});
288
296
```
289
297
290
-
### Extra Installer Scope
291
-
The `ExtraInstallerScope` provides a mechanism for injecting additional bindings into containers after their initial setup. Once an instance of this scope is created, it remains active until explicitly disposed, it acts as a post-installation hook for all containers built through `ContainerBuilder`.
292
-
This is especially useful in dynamic scenarios—for example, if you have fetched asynchronous dependencies in a boot scene and want to ensure they are available when transitioning into a gameplay scene. It supports use cases resembling a state machine, where the application moves from an "initializing" state to a "ready" state, injecting the required dependencies at the appropriate time.
293
-
294
-
Below is an example of a Boot scene that retrieves a remote configuration before transitioning to the Game scene. By the time the Game scene is loaded, the remote configuration is already registered within the Game scene's scope container.
0 commit comments