diff --git a/Assets/Reflex/Injectors/UnityInjector.cs b/Assets/Reflex/Injectors/UnityInjector.cs index b7f92b9..3d2a23f 100644 --- a/Assets/Reflex/Injectors/UnityInjector.cs +++ b/Assets/Reflex/Injectors/UnityInjector.cs @@ -26,12 +26,12 @@ private static void BeforeAwakeOfFirstSceneOnly() ReportReflexDebuggerStatus(); ContainersPerScene.Clear(); - var projectContainer = CreateProjectContainer(); + ProjectContainer = CreateProjectContainer(); void InjectScene(Scene scene) { ReflexLogger.Log($"Scene {scene.name} ({scene.GetHashCode()}) loaded", LogLevel.Development); - var sceneContainer = CreateSceneContainer(scene, projectContainer); + var sceneContainer = CreateSceneContainer(scene, ProjectContainer); ContainersPerScene.Add(scene, sceneContainer); SceneInjector.Inject(scene, sceneContainer); } @@ -48,7 +48,7 @@ void DisposeScene(Scene scene) void DisposeProject() { - ProjectContainer?.Dispose(); + ProjectContainer.Dispose(); ProjectContainer = null; // Unsubscribe from static events ensuring that Reflex works with domain reloading set to false