【发布时间】:2022-11-23 13:24:48
【问题描述】:
我有一个问题,我需要我的 Android 应用程序在后台保持活动状态。
Application.runInBackground = true;
【问题讨论】:
标签: c# android unity3d background
我有一个问题,我需要我的 Android 应用程序在后台保持活动状态。
Application.runInBackground = true;
【问题讨论】:
标签: c# android unity3d background
Project Settings, Player, Resolution and Presentation,勾选Run in Background选项。
【讨论】:
Unity 创建的 Android 应用程序无法在后台运行。 Application.runInBackground 在 Android 和 iOS 平台上被忽略。对于 Android,Unity 应用程序扩展 Activity 类,该类仅在应用程序处于焦点时运行。如果你想在后台运行一些东西,你应该在 Service 类中扩展和编写逻辑。 here 描述的很好。但它需要编写你自己的插件或类似的东西。
【讨论】: