libfile.so中的C++原型:
int fun1();
int fun2 (const char* strKey, const char* strValue);
C#调用:
声明:
[DllImport ("libfile")] //不需要加.so之类的,只需要名字,不需要后缀
private static extern int fun1();
[DllImport ("llibfile")]
private static extern int fun2(string strKey, string strValue);
调用
public int __fun1() {
return fun1();
}
return fun2(strKey, strValue);
}
unity调用中头文件都不需要了,应该类似于动态加载之类的。