Skip to content

Commit 76068b0

Browse files
EkranosMathijs-Bakker
authored andcommitted
Added define ZENJECT_DISABLE_DEFAULT_UI_ELEMENTS_INJECTION to disable default UI Elements injection
Fixes #55 for everyone adding the define to the project
1 parent 574bdc6 commit 76068b0

File tree

1 file changed

+1
-1
lines changed
  • UnityProject/Assets/Plugins/Zenject/Source/Runtime/Install/Contexts

1 file changed

+1
-1
lines changed

UnityProject/Assets/Plugins/Zenject/Source/Runtime/Install/Contexts/SceneContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void Install()
299299
// UIDocument is defined in the UI Elements package. In Unity 2021.1 the package was deprecated
300300
// in favor of including it in the UI Elements module. Earlier Unity versions already had that
301301
// module, but it does not include UIDocument.
302-
#if USE_UI_ELEMENTS_PACKAGE || (USE_UI_ELEMENTS_MODULE && UNITY_2021_1_OR_NEWER)
302+
#if (USE_UI_ELEMENTS_PACKAGE && !ZENJECT_DISABLE_DEFAULT_UI_ELEMENTS_INJECTION) || (USE_UI_ELEMENTS_MODULE && UNITY_2021_1_OR_NEWER && !ZENJECT_DISABLE_DEFAULT_UI_ELEMENTS_INJECTION)
303303
List<GameObject> rootObjectsInScene = new List<GameObject>();
304304
gameObject.scene.GetRootGameObjects(rootObjectsInScene);
305305
for (int i = 0; i < rootObjectsInScene.Count; i++)

0 commit comments

Comments
 (0)