native屏蔽安卓
This commit is contained in:
parent
ec3f574744
commit
e622f36f90
|
@ -201,11 +201,16 @@ public class TKGUtils
|
||||||
|
|
||||||
public static bool IsNativeReady()
|
public static bool IsNativeReady()
|
||||||
{
|
{
|
||||||
|
#if UNITY_IOS
|
||||||
return ToukaAdManager.Instance.IsReadyNative;
|
return ToukaAdManager.Instance.IsReadyNative;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowNative(Vector3 pTL, Vector3 pBR, string pAdPos, Camera pCam = null)
|
public static void ShowNative(Vector3 pTL, Vector3 pBR, string pAdPos, Camera pCam = null)
|
||||||
{
|
{
|
||||||
|
#if UNITY_IOS
|
||||||
Vector2 tTopLeft = RectTransformUtility.WorldToScreenPoint(pCam, pTL);
|
Vector2 tTopLeft = RectTransformUtility.WorldToScreenPoint(pCam, pTL);
|
||||||
Vector2 tBottomRight = RectTransformUtility.WorldToScreenPoint(pCam, pBR);
|
Vector2 tBottomRight = RectTransformUtility.WorldToScreenPoint(pCam, pBR);
|
||||||
float tWidth = Mathf.Abs(tBottomRight.x - tTopLeft.x);
|
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);
|
ToukaAdManager.Instance.ShowNative(tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight, pAdPos);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemoveNative()
|
public static void RemoveNative()
|
||||||
{
|
{
|
||||||
|
#if UNITY_IOS
|
||||||
ToukaAdManager.Instance.HideNative(false);
|
ToukaAdManager.Instance.HideNative(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
Loading…
Reference in New Issue