-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0537bbd
commit 4edfb20
Showing
1 changed file
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
using Reflex.Logging; | ||
using UnityEngine; | ||
using UnityEngine.Pool; | ||
|
||
namespace Reflex.Core | ||
{ | ||
public sealed class SceneScope : MonoBehaviour | ||
{ | ||
public void InstallBindings(ContainerBuilder containerBuilder) | ||
{ | ||
foreach (var nestedInstaller in GetComponentsInChildren<IInstaller>()) | ||
using var pooledObject = ListPool<IInstaller>.Get(out var installers); | ||
GetComponentsInChildren<IInstaller>(installers); | ||
|
||
for (var i = 0; i < installers.Count; i++) | ||
{ | ||
nestedInstaller.InstallBindings(containerBuilder); | ||
installers[i].InstallBindings(containerBuilder); | ||
} | ||
|
||
ReflexLogger.Log($"{nameof(SceneScope)} ({gameObject.scene.name}) Bindings Installed", LogLevel.Info, gameObject); | ||
ReflexLogger.Log($"SceneScope ({gameObject.scene.name}) Bindings Installed", LogLevel.Info, gameObject); | ||
} | ||
} | ||
} |