From a56f940890b3aeff00c5d52442323d4fbaf39d55 Mon Sep 17 00:00:00 2001 From: walon Date: Wed, 28 Sep 2022 15:35:37 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E6=B3=9B=E5=9E=8B=E7=B1=BB=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E9=9D=9E=E6=B3=9B=E5=9E=8B=E5=87=BD=E6=95=B0=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=A1=A5=E6=8E=A5=E5=87=BD=E6=95=B0=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/MetaUtil.cs | 1 - Editor/MethodBridge/Analyzer.cs | 9 +-------- Editor/MethodBridge/PlatformAdaptorBase.cs | 5 ++++- package.json | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Editor/MetaUtil.cs b/Editor/MetaUtil.cs index 78d4e95..e5f55ca 100644 --- a/Editor/MetaUtil.cs +++ b/Editor/MetaUtil.cs @@ -84,7 +84,6 @@ namespace HybridCLR.Editor public static IAssemblyResolver CreateBuildTargetAssemblyResolver(UnityEditor.BuildTarget target) { - List searchPaths = new List { SettingsUtil.GetHotFixDllsOutputDirByTarget(target) }; return new CombinedAssemblyResolver(new PathAssemblyResolver( SettingsUtil.GetHotFixDllsOutputDirByTarget(target)), new UnityPluginAssemblyResolver(), diff --git a/Editor/MethodBridge/Analyzer.cs b/Editor/MethodBridge/Analyzer.cs index 9e71b96..29cbae9 100644 --- a/Editor/MethodBridge/Analyzer.cs +++ b/Editor/MethodBridge/Analyzer.cs @@ -110,10 +110,6 @@ namespace HybridCLR.Editor.MethodBridge private void WalkType(TypeDef typeDef) { _typeDefs.Add(typeDef); - if (typeDef.HasGenericParameters) - { - return; - } ITypeDefOrRef baseType = typeDef.BaseType; if (baseType != null && baseType.TryGetGenericInstSig() != null) { @@ -122,10 +118,7 @@ namespace HybridCLR.Editor.MethodBridge } foreach (var method in typeDef.Methods) { - if (method.HasGenericParameters) - { - continue; - } + // 对于带泛型的参数,统率泛型共享为object _notGenericMethods.Add(method); } } diff --git a/Editor/MethodBridge/PlatformAdaptorBase.cs b/Editor/MethodBridge/PlatformAdaptorBase.cs index c5df11c..d146028 100644 --- a/Editor/MethodBridge/PlatformAdaptorBase.cs +++ b/Editor/MethodBridge/PlatformAdaptorBase.cs @@ -95,7 +95,10 @@ namespace HybridCLR.Editor.MethodBridge case ElementType.SZArray: case ElementType.FnPtr: case ElementType.Object: - case ElementType.Module: return GetNativeIntTypeInfo(); + case ElementType.Module: + case ElementType.Var: + case ElementType.MVar: + return GetNativeIntTypeInfo(); case ElementType.TypedByRef: return CreateValueType(type); case ElementType.ValueType: { diff --git a/package.json b/package.json index e50162e..1261e6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.focus-creative-games.hybridclr_unity", - "version": "0.3.2", + "version": "0.3.3", "displayName": "HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "category": "Runtime",