From 1b8dacabbe5eb3d67abfe5d09f5e76d411a15d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sat, 23 Dec 2023 22:36:10 +0100 Subject: [PATCH 1/6] Display SubInstallers by full name --- Assets/Package/Runtime/ContextInstaller.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Package/Runtime/ContextInstaller.cs b/Assets/Package/Runtime/ContextInstaller.cs index 6ae626c..fc012b2 100644 --- a/Assets/Package/Runtime/ContextInstaller.cs +++ b/Assets/Package/Runtime/ContextInstaller.cs @@ -9,7 +9,7 @@ namespace BroWar.Injection [AddComponentMenu("BroWar/Injection/Context Installer")] public class ContextInstaller : MonoInstaller { - [SerializeReference, ReferencePicker(TypeGrouping = TypeGrouping.ByFlatName), ReorderableList(elementLabel: "Installer")] + [SerializeReference, ReferencePicker, ReorderableList(elementLabel: "Installer")] private ISubInstaller[] installers; protected virtual void HandleInstallers() From baaccf57ff07fd9976cc652f9dea91bc354bb2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sun, 13 Sep 2026 23:00:01 +0200 Subject: [PATCH 2/6] Remove SetActiveScene calls caused by Zenject's internal editor scripts --- Assets/Package/CHANGELOG.md | 8 ++++++++ .../SceneParentLoading/SceneParentAutomaticLoader.cs | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Assets/Package/CHANGELOG.md b/Assets/Package/CHANGELOG.md index 1961410..ec2e378 100644 --- a/Assets/Package/CHANGELOG.md +++ b/Assets/Package/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.2.7 [13.09.2026] + +### Changed: +- Remove SetActiveScene calls caused by Zenject's internal editor scripts + ## 1.2.6 [27.04.2023] ### Changed: @@ -9,6 +14,7 @@ - RootContext implementation - FixedContext implementation - ContextOrderHelper implementation + ### Changed: - Rename ExposableInstaller to ExposableSubInstaller @@ -21,6 +27,7 @@ ### Added: - Processable installers and ISubProcessor interface + ### Changed: - Renamed: IMinorInstaller => ISubInstaller - Renamed: GeneralInstaller => ContextInstaller @@ -34,6 +41,7 @@ ### Added: - Possibility to predefine ProjectContext using InjectionManager + ### Changed: - Zenject update (v9.3.1) diff --git a/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs b/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs index c0f17a8..2e8950d 100644 --- a/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs +++ b/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs @@ -13,6 +13,7 @@ public static class SceneParentAutomaticLoader { static SceneParentAutomaticLoader() { + EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; EditorApplication.playModeStateChanged += OnPlayModeStateChanged; } @@ -177,7 +178,8 @@ static void ValidateDecoratedSceneMatch( if (activeIndex > decoratorIndex) { - EditorSceneManager.SetActiveScene(decoratorInfo.Scene); + //NOTE: there is no need to change Active Scene, Zenject logic doesn't require the parent scene to be active, and active Scene is crucial on some built-in Unity systems + //EditorSceneManager.SetActiveScene(decoratorInfo.Scene); } } @@ -193,7 +195,8 @@ static void ValidateParentChildMatch( if (activeIndex > parentIndex) { - EditorSceneManager.SetActiveScene(parentSceneInfo.Scene); + //NOTE: there is no need to change Active Scene, Zenject logic doesn't require the parent scene to be active, and active Scene is crucial on some built-in Unity systems + //EditorSceneManager.SetActiveScene(parentSceneInfo.Scene); } } From 461a896037dfbaa0ff50c643a09d834e9e4a6d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Sun, 13 Sep 2026 23:00:34 +0200 Subject: [PATCH 3/6] Update package.json --- Assets/Package/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Package/package.json b/Assets/Package/package.json index 0a34d38..206bb5d 100644 --- a/Assets/Package/package.json +++ b/Assets/Package/package.json @@ -1,7 +1,7 @@ { "name": "com.browar.injection", "displayName": "Injection", - "version": "1.2.6", + "version": "1.2.7", "unity": "2018.1", "description": "Dependency Injection system.", "keywords": [ From 0b14b00f305f72c034e4a01f97fedb4b1527320f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Mon, 14 Sep 2026 00:01:20 +0200 Subject: [PATCH 4/6] Ignore SetActiveScene calls only if AutoRun is disabled --- .../SceneParentLoading/SceneParentAutomaticLoader.cs | 10 +++++----- .../Runtime/Install/Contexts/RunnableContext.cs | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs b/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs index 2e8950d..f9a8c06 100644 --- a/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs +++ b/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs @@ -176,10 +176,10 @@ static void ValidateDecoratedSceneMatch( "Decorator scene '{0}' must be loaded before decorated scene '{1}'. Please drag the decorator scene to be placed above the other scene in the scene hierarchy.", decoratorInfo.Scene.name, decoratedInfo.Scene.name); + var decoratorContext = decoratorInfo.DecoratorContext; if (activeIndex > decoratorIndex) { - //NOTE: there is no need to change Active Scene, Zenject logic doesn't require the parent scene to be active, and active Scene is crucial on some built-in Unity systems - //EditorSceneManager.SetActiveScene(decoratorInfo.Scene); + EditorSceneManager.SetActiveScene(decoratorInfo.Scene); } } @@ -193,10 +193,10 @@ static void ValidateParentChildMatch( Assert.That(parentIndex < childIndex, "Parent scene '{0}' must be loaded before child scene '{1}'. Please drag it to be placed above its child in the scene hierarchy.", parentSceneInfo.Scene.name, sceneInfo.Scene.name); - if (activeIndex > parentIndex) + var parentContext = parentSceneInfo.SceneContext; + if (activeIndex > parentIndex && parentContext != null && parentContext.AutoRun) { - //NOTE: there is no need to change Active Scene, Zenject logic doesn't require the parent scene to be active, and active Scene is crucial on some built-in Unity systems - //EditorSceneManager.SetActiveScene(parentSceneInfo.Scene); + EditorSceneManager.SetActiveScene(parentSceneInfo.Scene); } } diff --git a/Assets/Package/Plugins/Zenject/Runtime/Install/Contexts/RunnableContext.cs b/Assets/Package/Plugins/Zenject/Runtime/Install/Contexts/RunnableContext.cs index e37e7a9..07358f6 100644 --- a/Assets/Package/Plugins/Zenject/Runtime/Install/Contexts/RunnableContext.cs +++ b/Assets/Package/Plugins/Zenject/Runtime/Install/Contexts/RunnableContext.cs @@ -17,7 +17,9 @@ public abstract class RunnableContext : Context static bool _staticAutoRun = true; public bool Initialized { get; private set; } - + + public bool AutoRun => _autoRun; + #if UNITY_EDITOR // Required for disabling domain reload in enter the play mode feature. See: https://docs.unity3d.com/Manual/DomainReloading.html [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] @@ -27,7 +29,7 @@ static void ResetStaticValues() { return; } - + _staticAutoRun = true; } #endif @@ -36,7 +38,7 @@ static void ResetStaticValues() protected override void ResetInstanceFields() { base.ResetInstanceFields(); - + Initialized = false; } #endif From 707e43ae6e6176a97afc5e34e92c6f5f9ceb9f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Mon, 14 Sep 2026 00:02:01 +0200 Subject: [PATCH 5/6] Minor refactor changes --- .../Editor/SceneParentLoading/SceneParentAutomaticLoader.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs b/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs index f9a8c06..4ae6450 100644 --- a/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs +++ b/Assets/Package/Plugins/Zenject/Editor/SceneParentLoading/SceneParentAutomaticLoader.cs @@ -176,7 +176,6 @@ static void ValidateDecoratedSceneMatch( "Decorator scene '{0}' must be loaded before decorated scene '{1}'. Please drag the decorator scene to be placed above the other scene in the scene hierarchy.", decoratorInfo.Scene.name, decoratedInfo.Scene.name); - var decoratorContext = decoratorInfo.DecoratorContext; if (activeIndex > decoratorIndex) { EditorSceneManager.SetActiveScene(decoratorInfo.Scene); From bce15de8fb54e32937f055e687923ea1a6b3e366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Matkowski?= Date: Tue, 15 Sep 2026 00:45:51 +0200 Subject: [PATCH 6/6] Update CHANGELOG.md & package.json --- Assets/Package/CHANGELOG.md | 5 +++++ Assets/Package/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/Package/CHANGELOG.md b/Assets/Package/CHANGELOG.md index ec2e378..2f8c2aa 100644 --- a/Assets/Package/CHANGELOG.md +++ b/Assets/Package/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.2.8 [15.09.2026] + +### Changed: +- Adjust SceneParentAutomaticLoader to affect only AutoRun-based SceneContexts + ## 1.2.7 [13.09.2026] ### Changed: diff --git a/Assets/Package/package.json b/Assets/Package/package.json index 206bb5d..781493d 100644 --- a/Assets/Package/package.json +++ b/Assets/Package/package.json @@ -1,7 +1,7 @@ { "name": "com.browar.injection", "displayName": "Injection", - "version": "1.2.7", + "version": "1.2.8", "unity": "2018.1", "description": "Dependency Injection system.", "keywords": [