Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am working with unity for an iOS game. For unlocking achievement I need to access a "Achievement.mm" file from my c# code:
[DllImport("__Internal")]
private static extern void
GKAchievement(string achievementID, float progress, bool value);
I got this code from a forum. But, what does the "__Internal" means ?
–
Plugins link their code to C# unity using [DllImport()]
.
__internal
is a keyword used for static linking needed by specific platforms, such as XBox and iOS.
Other platforms usually use dynamic linking, hence this is not needed.
Please for more info refer to: https://docs.unity3d.com/Manual/NativePlugins.html
Just the minor tip.
If the library being loaded is __Internal
, then the main program is searched for method symbols. This happens to be the case on iOS platform.
The plugins on iOS cannot load dynamically. Only statically as @RaxelZ explained.
It is different for OSX, Windows, Android ... those platforms may load plugins dynamically. For iOS, only statically.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.