Skip to content

热更成功,但有个方法Patch会报错(报错的方法里面调用了一个带有ref参数的event的注册回调的操作) #149

@MrNerverDie

Description

@MrNerverDie

报错信息:
ExecutionEngineException: Attempting to call method 'System.Threading.Interlocked::CompareExchange<MoleMole.LevelBorder+BorderChange>' for which no ahead of time (AOT) code was generated.
06-12 19:34:17.195 10092 10156 E Unity : at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0
06-12 19:34:17.195 10092 10156 E Unity : at IFix.Core.ReflectionMethodInvoker.Invoke (IFix.Core.VirtualMachine virtualMachine, IFix.Core.Call& call, System.Boolean isInstantiate) [0x00000] in <00000000000000000000000000000000>:0
06-12 19:34:17.195 10092 10156 E Unity : at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction* pc, IFix.Core.Value* argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value** topWriteBack) [0x00000] in <00000000000000000000000000000000>:0
06-12 19:34:17.195 10092 10156 E Unity : at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction* pc,

相应的报错位置
MonoBasicLevel.levelManager.GetLevelBorder().OnGetLevelBorder -= OnGetLevelBorder
其中OnGetLevelBorder是一个定义有ref参数的event
`

	public delegate void BorderChange(ref Vector2 border);

	public event BorderChange OnGetLevelBorder;

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions