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
If you want a scene to inherit services from another scene, you can use the `ReflexSceneManager::OverrideSceneParentContainer` method. This feature provides developers with more granular control over which parent container is used for each newly loaded scene.
217
+
### Parent Override Scope
218
+
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.
By utilizing this API, you can create hierarchical structures such as the one shown below:
@@ -238,8 +241,6 @@ By utilizing this API, you can create hierarchical structures such as the one sh
238
241
graph
239
242
ProjectContainer-->BootScene
240
243
BootScene-->LobbyScene
241
-
LobbyScene-->GameModeOneScene
242
-
LobbyScene-->GameModeTwoScene
243
244
```
244
245
245
246
@@ -286,6 +287,35 @@ using var scopedContainer = parentContainer.Scope(builder =>
286
287
});
287
288
```
288
289
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.
@@ -551,14 +581,6 @@ An alternative approach is to utilize the `GameObjectSelfInjector`, which can be
551
581
552
582
## 🧩 Extensions
553
583
554
-
### ParentOverrideScope
555
-
The `ParentOverrideScope` 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.
556
-
This is particularly useful when you want one scene to inherit services from another, enabling fine-grained control over which parent container is used for each newly loaded scene.
557
-
558
-
### ExtraInstallerScope
559
-
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`.
560
-
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.
561
-
562
584
### GetSceneContainer
563
585
```csharp
564
586
// Allows you to get a scene container, allowing you to resolve/inject dependencies in a different way during runtime
0 commit comments