diff --git a/Assets/XLua/Src/Editor/Hotfix.cs b/Assets/XLua/Src/Editor/Hotfix.cs index 446ca05de..14190cd7f 100644 --- a/Assets/XLua/Src/Editor/Hotfix.cs +++ b/Assets/XLua/Src/Editor/Hotfix.cs @@ -648,7 +648,25 @@ static MethodReference findBase(TypeDefinition type, MethodDefinition method) var m = findOverride(tbase, method); if (m != null) { - return m; + if (type.BaseType.IsGenericInstance) + { + //(type.BaseType as GenericInstanceType).GenericArguments + var reference = new MethodReference(m.Name, m.ReturnType, type.BaseType) + { + HasThis = m.HasThis, + ExplicitThis = m.ExplicitThis, + CallingConvention = m.CallingConvention + }; + foreach (var parameter in m.Parameters) + reference.Parameters.Add(new ParameterDefinition(parameter.ParameterType)); + foreach (var generic_parameter in m.GenericParameters) + reference.GenericParameters.Add(new GenericParameter(generic_parameter.Name, reference)); + return reference; + } + else + { + return m; + } } tbase = tbase.BaseType.Resolve(); } diff --git a/Tools/XLuaHotfixInject.exe b/Tools/XLuaHotfixInject.exe index 19224da33..061e1fbaf 100644 Binary files a/Tools/XLuaHotfixInject.exe and b/Tools/XLuaHotfixInject.exe differ diff --git a/Tools/XLuaHotfixInject.pdb b/Tools/XLuaHotfixInject.pdb index af3cbfcca..15b683d72 100644 Binary files a/Tools/XLuaHotfixInject.pdb and b/Tools/XLuaHotfixInject.pdb differ