Version: Unity 6.7 Alpha (6000.7)
Language : English
Activity requirements and compatibility
Create a custom activity

Extend the default Unity activity

The UnityPlayerActivity of a Unity Android application is responsible for basic interactions between the Android operating system and the application. You can use plug-insA 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
to create your own Activity that extends and overrides Unity’s default UnityPlayerActivity.

Notes:

  • If you’re creating a custom activity with GameActivity application entry point, you need to extend the UnityPlayerGameActivity class.
  • UnityPlayerActivity and UnityPlayerGameActivity use the UnityPlayerForActivityOrService and UnityPlayerForGameActivity bridge classes respectively. Unity splits these bridge classes from the UnityPlayer Java class. To create a custom activity, extend UnityPlayerActivity or UnityPlayerGameActivity and not the bridge classes. If your activity code references the UnityPlayer class directly, rename it to the relevant bridge class to avoid compile errors.
Topic Description
Create a custom activity Extend the default Unity activity to control interactions between Unity and Android.
Specify Android Player command-line arguments Specify startup command-line arguments to pass to Unity.

Additional resources

Activity requirements and compatibility
Create a custom activity
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961