From fc9696b17f6de525b766a2300d6ae82e9388ff6b Mon Sep 17 00:00:00 2001 From: Steve Vermeulen Date: Sun, 7 Oct 2018 10:31:31 +0800 Subject: [PATCH 1/2] Updated url to repo --- .../Assets/Plugins/Zenject/Source/Binding/BindingUtil.cs | 4 ++-- .../Assets/Plugins/Zenject/Source/Editor/ZenMenuItems.cs | 2 +- .../Plugins/Zenject/Source/Install/Contexts/StaticContext.cs | 2 +- .../Zenject/Source/Providers/CachedOpenTypeProvider.cs | 2 +- .../Assets/Plugins/Zenject/Source/Providers/CachedProvider.cs | 2 +- .../Plugins/Zenject/Source/Util/ZenReflectionTypeAnalyzer.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Binding/BindingUtil.cs b/UnityProject/Assets/Plugins/Zenject/Source/Binding/BindingUtil.cs index 144db7802..e1f256a01 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Binding/BindingUtil.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Binding/BindingUtil.cs @@ -30,7 +30,7 @@ public static void AssertIsValidPrefab(UnityEngine.Object prefab) #if UNITY_EDITOR // Unfortunately we can't do this check because asset bundles return PrefabType.None here - // as discussed here: https://github.com/modesttree/Zenject/issues/269#issuecomment-323419408 + // as discussed here: https://github.com/svermeulen/Zenject/issues/269#issuecomment-323419408 //Assert.That(PrefabUtility.GetPrefabType(prefab) == PrefabType.Prefab, //"Expected prefab but found game object with name '{0}' during bind command", prefab.name); #endif @@ -45,7 +45,7 @@ public static void AssertIsValidGameObject(GameObject gameObject) #if UNITY_EDITOR // Unfortunately we can't do this check because asset bundles return PrefabType.None here - // as discussed here: https://github.com/modesttree/Zenject/issues/269#issuecomment-323419408 + // as discussed here: https://github.com/svermeulen/Zenject/issues/269#issuecomment-323419408 //Assert.That(PrefabUtility.GetPrefabType(gameObject) != PrefabType.Prefab, //"Expected game object but found prefab instead with name '{0}' during bind command", gameObject.name); #endif diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Editor/ZenMenuItems.cs b/UnityProject/Assets/Plugins/Zenject/Source/Editor/ZenMenuItems.cs index a12850591..3ed19c07c 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Editor/ZenMenuItems.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Editor/ZenMenuItems.cs @@ -30,7 +30,7 @@ public static void ValidateCurrentSceneThenRun() [MenuItem("Edit/Zenject/Help...")] public static void OpenDocumentation() { - Application.OpenURL("https://github.com/modesttree/zenject"); + Application.OpenURL("https://github.com/svermeulen/zenject"); } [MenuItem("GameObject/Zenject/Scene Context", false, 9)] diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Install/Contexts/StaticContext.cs b/UnityProject/Assets/Plugins/Zenject/Source/Install/Contexts/StaticContext.cs index 49044c366..c4933d403 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Install/Contexts/StaticContext.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Install/Contexts/StaticContext.cs @@ -3,7 +3,7 @@ namespace Zenject { // For some platforms, it's desirable to be able to add dependencies to Zenject before - // Unity even starts up (eg. WSA as described here https://github.com/modesttree/Zenject/issues/118) + // Unity even starts up (eg. WSA as described here https://github.com/svermeulen/Zenject/issues/118) // In those cases you can call StaticContext.Container.BindX to add dependencies // Anything you add there will then be injected everywhere, since all other contexts // should be children of StaticContext diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedOpenTypeProvider.cs b/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedOpenTypeProvider.cs index 18470cef3..e7c89dd1c 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedOpenTypeProvider.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedOpenTypeProvider.cs @@ -49,7 +49,7 @@ public int NumInstances } // This method can be called if you want to clear the memory for an AsSingle instance, - // See isssue https://github.com/modesttree/Zenject/issues/441 + // See isssue https://github.com/svermeulen/Zenject/issues/441 public void ClearCache() { #if ZEN_MULTITHREADING diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedProvider.cs b/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedProvider.cs index f5bb02cd8..f883a44c4 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedProvider.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Providers/CachedProvider.cs @@ -50,7 +50,7 @@ public int NumInstances } // This method can be called if you want to clear the memory for an AsSingle instance, - // See isssue https://github.com/modesttree/Zenject/issues/441 + // See isssue https://github.com/svermeulen/Zenject/issues/441 public void ClearCache() { #if ZEN_MULTITHREADING diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Util/ZenReflectionTypeAnalyzer.cs b/UnityProject/Assets/Plugins/Zenject/Source/Util/ZenReflectionTypeAnalyzer.cs index d9b0fe8bd..57c5430f3 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Util/ZenReflectionTypeAnalyzer.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Util/ZenReflectionTypeAnalyzer.cs @@ -228,7 +228,7 @@ static ConstructorInfo TryGetInjectConstructor(Type type) // This might result in some non obvious errors like null reference exceptions // but is probably the best trade-off since it allows zenject to be more compatible // with libraries that don't depend on zenject at all - // Discussion here - https://github.com/modesttree/Zenject/issues/416 + // Discussion here - https://github.com/svermeulen/Zenject/issues/416 return constructors.OrderBy(x => x.GetParameters().Count()).First(); } From 07100a8fc6989ed2ee968e083640a25758dd63dd Mon Sep 17 00:00:00 2001 From: Steve Vermeulen Date: Sun, 7 Oct 2018 10:33:42 +0800 Subject: [PATCH 2/2] Changed FromComponentsInHierarchy to require scope set --- .../TestFromComponentInHierarchy.cs | 8 ++++---- .../Source/Binding/Binders/FromBinders/FromBinder.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UnityProject/Assets/Plugins/Zenject/OptionalExtras/IntegrationTests/Tests/Bindings/TestFromComponentInHierarchy/TestFromComponentInHierarchy.cs b/UnityProject/Assets/Plugins/Zenject/OptionalExtras/IntegrationTests/Tests/Bindings/TestFromComponentInHierarchy/TestFromComponentInHierarchy.cs index d6c7931e3..2756e6374 100644 --- a/UnityProject/Assets/Plugins/Zenject/OptionalExtras/IntegrationTests/Tests/Bindings/TestFromComponentInHierarchy/TestFromComponentInHierarchy.cs +++ b/UnityProject/Assets/Plugins/Zenject/OptionalExtras/IntegrationTests/Tests/Bindings/TestFromComponentInHierarchy/TestFromComponentInHierarchy.cs @@ -58,7 +58,7 @@ public IEnumerator RunMatchMultiple() Setup1(); PreInstall(); Container.Bind().AsSingle(); - Container.Bind().FromComponentsInHierarchy(); + Container.Bind().FromComponentsInHierarchy().AsCached(); PostInstall(); @@ -88,7 +88,7 @@ public IEnumerator RunMatchNotFoundSuccess() PreInstall(); Container.Bind().AsSingle().NonLazy(); - Container.Bind().FromComponentsInHierarchy(); + Container.Bind().FromComponentsInHierarchy().AsCached(); PostInstall(); @@ -134,7 +134,7 @@ public IEnumerator RunMatchMultipleNonGeneric() Setup1(); PreInstall(); Container.Bind().AsSingle(); - Container.Bind(typeof(Foo)).FromComponentsInHierarchy(); + Container.Bind(typeof(Foo)).FromComponentsInHierarchy().AsCached(); PostInstall(); @@ -164,7 +164,7 @@ public IEnumerator RunMatchNotFoundSuccessNonGeneric() PreInstall(); Container.Bind().AsSingle().NonLazy(); - Container.Bind(typeof(Foo)).FromComponentsInHierarchy(); + Container.Bind(typeof(Foo)).FromComponentsInHierarchy().AsCached(); PostInstall(); diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Binding/Binders/FromBinders/FromBinder.cs b/UnityProject/Assets/Plugins/Zenject/Source/Binding/Binders/FromBinders/FromBinder.cs index c5ccd1d66..8af2e64b6 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Binding/Binders/FromBinders/FromBinder.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Binding/Binders/FromBinders/FromBinder.cs @@ -747,7 +747,7 @@ protected ScopeConcreteIdArgConditionCopyNonLazyBinder FromComponentsInHierarchy { BindingUtil.AssertIsInterfaceOrComponent(AllParentTypes); - BindInfo.RequireExplicitScope = false; + BindInfo.RequireExplicitScope = true; // Don't know how it's created so can't assume here that it violates AsSingle BindInfo.MarkAsCreationBinding = false;