- Home /
Native type conversions
I'm working on a Unity native plugin for iOs/Android: I can import the compiled native library, get some basic method to work, but now I cannot seem to find some authoritative document on the details of native methods calls.
Specifically I would like to know about type conversion, for instance:
i. this table of conversions correct?
#C (unity) C
-------------------------------
int int
string char[]
bool int
float float
double double
is there some automatic promotion/demotion of variables involved?
ii. what is the type conversion of structs (like Vectors and Quaternions)? Is it even legal to pass them to native methods?
iii. how are arrays converted? I'm assuming a bool[] will become a int[], but I'm not sure.
iv. is there a way to pass more complex structures, like Lists and dictionaries?
Any direct answer or pointer to official documentation is welcome!
Thank you!