From 8495d61cebe4175b358370a3599b32ae976d6de6 Mon Sep 17 00:00:00 2001 From: Peyman Narimani Date: Sat, 14 May 2022 20:20:28 +0430 Subject: [PATCH] Ignore UnityEngine classes from TypeAnalyzer --- .../Plugins/Zenject/Source/Runtime/Util/TypeAnalyzer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Util/TypeAnalyzer.cs b/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Util/TypeAnalyzer.cs index 65989f534..d4f8ea77b 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Util/TypeAnalyzer.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Util/TypeAnalyzer.cs @@ -232,8 +232,12 @@ static InjectTypeInfo GetInfoInternal(Type type) public static bool ShouldSkipTypeAnalysis(Type type) { return type == null || type.IsEnum() || type.IsArray || type.IsInterface() - || type.ContainsGenericParameters() || IsStaticType(type) - || type == typeof(object); + || type.ContainsGenericParameters() || IsStaticType(type) + || type == typeof(object) +#if !NOT_UNITY3D + || (type.Namespace != null && type.Namespace.Contains("UnityEngine")) +#endif + ; } static bool IsStaticType(Type type)