From e622f36f900e3f6bcf196a90c608633ae9efd3cb Mon Sep 17 00:00:00 2001 From: yangjing Date: Mon, 13 Jun 2022 18:43:10 +0800 Subject: [PATCH] =?UTF-8?q?native=E5=B1=8F=E8=94=BD=E5=AE=89=E5=8D=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/TKGSDK/Common/GameInterface/TKGUtils.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/TKGSDK/Common/GameInterface/TKGUtils.cs b/Assets/TKGSDK/Common/GameInterface/TKGUtils.cs index 8231a607..6821a8ac 100644 --- a/Assets/TKGSDK/Common/GameInterface/TKGUtils.cs +++ b/Assets/TKGSDK/Common/GameInterface/TKGUtils.cs @@ -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 } \ No newline at end of file