Version: 2023.2
Language : English
Introducing native plug-ins for Android
Import a native plug-in for Android

Create a native plug-in for Android

To compile a C++ plug-inA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblies created with tools like Visual Studio) and Native plug-ins (platform-specific native code libraries). More info
See in Glossary
for Android, use the Android NDK and familiarize yourself with the steps required to build a shared library or a static library.

If you use C++ to implement the plug-in, you must declare with C linkage to avoid name mangling issues. By default, only C source files that have a .c file extension in the plug-ins have C linkage (not C++).

extern "C" {
  float Foopluginmethod ();
}

Additional resources

Import a native plug-in for Android

Introducing native plug-ins for Android
Import a native plug-in for Android
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961