NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we’re attempting to marshal is: UMP.Wrappers.WrapperStandalone::DebugLogHandler
NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we’re attempting to marshal is: UMP.MediaPlayerStandalone::InitBufferSize
using AOT;
[MonoPInvokeCallback(typeof(ManageLogCallback))]
private static void DebugLogHandler(string msg)
{
UnityEngine.Debug.LogError(msg);
}
_manageBufferSizeCallback = InitBufferSizeCallBack;
[MonoPInvokeCallback(typeof(ManageBufferSizeCallback))]
private static void InitBufferSizeCallBack(int width, int height)
{
if(instance!=null)
{
instance.InitBufferSize(width,height);
}
}
1、必须使用[MonoPInvokeCallback(typeof(ManageBufferSizeCallback))]
2、必须改为static方法