Indicates the Unity bridge Java instance used by an activity or a service.
Note: This object is managed by Unity runtime, so do not call AndroidJavaObject.Dispose on it.
using UnityEngine; using UnityEngine.Android;
public class Controller : MonoBehaviour { void Start() { var bridgeClass = AndroidApplication.unityPlayer.Call<string>("toString"); var isActivity = bridgeClass.StartsWith("com.unity3d.player.UnityPlayerForActivityOrService"); var isGameActivity = bridgeClass.StartsWith("com.unity3d.player.UnityPlayerForGameActivity"); Debug.Log($"Class for Activity: {isActivity}, Class for GameActivity: {isGameActivity}"); } }