native屏蔽安卓

This commit is contained in:
yangjing 2022-06-13 18:43:10 +08:00
parent ec3f574744
commit e622f36f90
1 changed files with 9 additions and 1 deletions

View File

@ -201,11 +201,16 @@ public class TKGUtils
public static bool IsNativeReady()
{
#if UNITY_IOS
return ToukaAdManager.Instance.IsReadyNative;
#else
return false;
#endif
}
public static void ShowNative(Vector3 pTL, Vector3 pBR, string pAdPos, Camera pCam = null)
{
#if UNITY_IOS
Vector2 tTopLeft = RectTransformUtility.WorldToScreenPoint(pCam, pTL);
Vector2 tBottomRight = RectTransformUtility.WorldToScreenPoint(pCam, pBR);
float tWidth = Mathf.Abs(tBottomRight.x - tTopLeft.x);
@ -221,11 +226,14 @@ public class TKGUtils
{
ToukaAdManager.Instance.ShowNative(tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight, pAdPos);
}
#endif
}
public static void RemoveNative()
{
#if UNITY_IOS
ToukaAdManager.Instance.HideNative(false);
#endif
}
#endregion
#endregion
}