UnityPlugin icon indicating copy to clipboard operation
UnityPlugin copied to clipboard

Doesn't work with IL2CPP

Open d4rkd3v1l opened this issue 7 years ago • 3 comments

Sadly this approach isn't working anymore with unity's il2cpp compiler. So it seems like the only remaining option is unity's SendMessage, which is just a pain in the ass?

NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. at UnityPlugin.Awake () [0x00000] in :0

d4rkd3v1l avatar Apr 10 '17 15:04 d4rkd3v1l

Will this help?

https://answers.unity.com/questions/1229036/callbacks-from-c-to-c-are-not-working-in-540f3.html

karsnen avatar Jun 15 '18 22:06 karsnen

Yep, for anyone else reading this, the solution is to make your C# callback delegate methods static.

s-hocking avatar Jul 20 '18 06:07 s-hocking

so sad, I just want to pass a non-static c# callback to c++, but it can't

caochao avatar Jun 20 '19 13:06 caochao