You can use plug-ins to deliver resources and call Java and C++ code created outside of Unity from your C# scripts. They enable you to access features, like third-party code libraries and operating systems calls, that would otherwise not be available to Unity. For more information about plug-ins with Unity, see Plug-ins.
This section describes how to create your own plug-ins and use them in Android projects. The information on these pages assumes you already know how to create native plug-ins for Unity. For more information about native plug-ins and their uses, see Native plug-ins.
Topic | 描述 |
---|---|
Android plug-in types | Understand the different plug-in types available for Unity Android applications. |
Call Java and Kotlin plug-in code from C# scripts | Interact with Java and Kotlin plug-in code from your C# scripts. |
Extend the default Unity activity | Override basic interactions between the Android operating system and the Unity Android application. |
如果您将项目升级到 Unity 2019.4 或更高版本,将 Unity 作为库使用这一功能可能需要您调整您的原生和托管 插件,以便在 Android 上正常工作。