Я пытаюсь чтобы исправить префикс метода, и в редакторе метод успешно исправлен, но в экспортированной сборке метод не может быть исправлен, и выдается следующее исключение:
Код: Выделить всё
System.ArgumentException: GenericArguments[0], 'MonoMod.Utils.Cil.CecilILGenerator', on 'MonoMod.Utils.Cil.ILGeneratorProxy[TTarget]' violates the constraint of type 'TTarget'.
---> System.TypeLoadException: GenericArguments[0], 'MonoMod.Utils.Cil.CecilILGenerator', on 'MonoMod.Utils.Cil.ILGeneratorProxy[TTarget]' violates the constraint of type parameter 'TTarget'.
at System.RuntimeTypeHandle.Instantiate(RuntimeType inst)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
--- End of inner exception stack trace ---
at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
at MonoMod.Utils.Cil.ILGeneratorShim.GetProxy()
at MonoMod.Utils.DynamicMethodDefinition.GetILGenerator()
at HarmonyLib.MethodPatcher..ctor(MethodBase original, MethodBase source, List`1 prefixes, List`1 postfixes, List`1 transpilers, List`1 finalizers, Boolean debug)
at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
at HarmonyLib.PatchProcessor.Patch()
at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer)
at HarmonyTester.Test() in G:\Godot Projects\HarmonyExportIssue\HarmonyTesting\HarmonyTester.cs:line 24
p>
Минимально воспроизводимый пример (Godot 4.2.1-mono)
Встроенная версия примера
Подробнее здесь: https://stackoverflow.com/questions/785 ... oes-not-wo