How to implement Unity as an internal call with mono

C # side code

[WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall)] private extern void INTERNAL_set_rotation(ref Quaternion value); 

How to derive this method from C ++ to mono

Thanks.

+4
source share
1 answer

You need to call mono_add_internal_call :

 mono_add_internal_call ("YourClass::INTERNAL_set_rotation", yourclass_INTERNAL_set_rotation); 

There is documentation here: http://www.mono-project.com/Embedding_Mono#Exposing_C_code_to_the_CIL_universe

And here is a sample code: https://github.com/mono/moon/blob/8d8ece884382d653d215b0da5bf633079566d816/src/deployment.cpp#L579

+8
source

Source: https://habr.com/ru/post/1432402/


All Articles