18 lines
419 B
C#
18 lines
419 B
C#
#if UNITY_ANDROID
|
|
using UnityEngine;
|
|
|
|
namespace Unity.Services.Mediation.Platform
|
|
{
|
|
static class ActivityUtil
|
|
{
|
|
public static AndroidJavaObject GetUnityActivity()
|
|
{
|
|
using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
|
{
|
|
return unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|