"[DllImport("__Internal")]" - what does the "__Internal" mean?

zamiurratul picture zamiurratul · Jul 26, 2016 · Viewed 7.5k times · Source

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 ?

Answer

Razzlez picture Razzlez · Oct 23, 2017
  • 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