Here is my simple flow of callback from ios to unity.
private delegate void CallbackDelegate();
[DllImport("__Internal")]
private static extern void PluginFunction(CallbackDelegate callback);
void Start()
{
PluginFunction(CallbackMethod);
}
[MonoPInvokeCallback(typeof(CallbackDelegate))]
void CallbackMethod()
{
Debug.Log("Working...");
}
C side code
extern "C" typedef void (*CallBackFuncP) ();
extern "C" {
void PluginFunction(CallBackFuncP callback) {
callback();
}
}
I am getting this exception after upgrading to Unity 5.4.0f3 working on previous version
> Blockquote NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code.
↧