Commit 3d88ea64 authored by zhangzhe's avatar zhangzhe

修改插屏广告

parent 3c6adb44
......@@ -62,7 +62,7 @@ public class CSJInterstitialUtil
var adSlot = new AdSlot.Builder()
#if UNITY_IOS
.SetCodeId(entity.codeId)
.SetExpressViewAcceptedSize(800, 1200)
.SetExpressViewAcceptedSize(Screen.width * 5 / 6f, Screen.width * 6 / 4f)
#else
.SetCodeId(entity.codeId)
.SetExpressViewAcceptedSize(350, 0)
......
......@@ -52,8 +52,8 @@ public class GDTInterstitialAdUtil
if (interstitialAdCacheList.Count > 0)
{
UnifiedInterstitialAd interAd = interstitialAdCacheList.Dequeue();
interAd.SetListener(new UnifiedInterstitialAdListener(entity,interAd, listener, callback));
interAd.Show();
interAd.SetListener(new UnifiedInterstitialAdListener(entity,interAd, listener, callback));
}
else
{
......@@ -113,7 +113,9 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdExposured()
{
#if UNITY_ANDROID
callback(true);
#endif
if (listener != null)
{
listener.onInterstitialAdShow();
......@@ -141,6 +143,9 @@ public class GDTInterstitialAdUtil
/// </summary>
public void OnAdClosed()
{
#if UNITY_IOS
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
#endif
if (listener != null)
{
listener.onInterstitialClose();
......
......@@ -221,15 +221,18 @@ public class AdUtils
}
public static void showInterAd(ZXADInterstitialListener listener)
public static void showInterAd(string actionName, ZXADInterstitialListener listener)
{
IsShowRewardAd = true;
#if UNITY_EDITOR
listener.onInterstitialClose();
return;
#endif
AdManager.Instance.PlayCacheInterstitialAd("Interstitial", "InterstitialAd", listener);
AdManager.Instance.PlayCacheInterstitialAd("Interstitial", actionName, listener);
#if UNITY_ANDROID
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
#endif
}
......
......@@ -437,8 +437,7 @@ public class DialogControl : MonoBehaviour
PlayerPrefs.SetInt("CLICL_RED_PACK", a + 1);
if (PlayerPrefs.GetInt("CLICL_RED_PACK") % 5 == 0)
{
AdManager.Instance.PlayCacheInterstitialAd("Interstitial", "mrcqg", new InterstitialAdListener());
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
AdUtils.showInterAd("mrcqg", new InterstitialAdListener());
}
}
......@@ -619,8 +618,7 @@ public class DialogControl : MonoBehaviour
PlayerPrefs.SetInt("CLICL_RED_PACK", a + 1);
if (PlayerPrefs.GetInt("CLICL_RED_PACK") % 5 == 0)
{
AdManager.Instance.PlayCacheInterstitialAd("Interstitial", "qtjs", new InterstitialAdListener());
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
AdUtils.showInterAd("qtjs", new InterstitialAdListener());
}
}
private void moveAllSpeedDialog()
......@@ -746,8 +744,7 @@ public class DialogControl : MonoBehaviour
// if (PlayerPrefs.GetInt("CLICL_RED_PACK") % 5 == 0)
// {
// AdManager.Instance.PlayCacheInterstitialAd("Interstitial", "djhb", new InterstitialAdListener());
// AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
// AdUtils.showInterAd("djhb", new InterstitialAdListener());
// }
......@@ -952,9 +949,7 @@ public class DialogControl : MonoBehaviour
PlayerPrefs.SetInt("CLICL_RED_PACK", a + 1);
if (PlayerPrefs.GetInt("CLICL_RED_PACK") % 5 == 0)
{
AdManager.Instance.PlayCacheInterstitialAd("Interstitial", "wxlw", new InterstitialAdListener());
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
AdUtils.showInterAd("wxlw", new InterstitialAdListener());
}
}
public void closeBoxReward()
......@@ -1007,9 +1002,7 @@ public class DialogControl : MonoBehaviour
PlayerPrefs.SetInt("CLICL_RED_PACK", a + 1);
if (PlayerPrefs.GetInt("CLICL_RED_PACK") % 5 == 0)
{
AdUtils.showInterAd(new InterstitialAdListener());
// AdManager.Instance.PlayCacheInterstitialAd("Interstitial", "txtc", new InterstitialAdListener());
// AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
AdUtils.showInterAd("InterstitialAd", new InterstitialAdListener());
}
}
//关闭种树提现弹窗
......@@ -1040,7 +1033,7 @@ public class DialogControl : MonoBehaviour
public void onInterstitialClose()
{
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
}
public void onInterstitialError(string errorMsg)
......
......@@ -45,7 +45,7 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
private void playIntersitialAd()
{
Debug.Log("无操作播放插屏广告");
AdUtils.showInterAd( new InterstitialAdListener());
AdUtils.showInterAd("InterstitialAd", new InterstitialAdListener());
}
private sealed class InterstitialAdListener : ZXADInterstitialListener
{
......@@ -58,6 +58,7 @@ public class HomeInfoControl : MonoBehaviour, HomeContract.View
public void onInterstitialClose()
{
Debug.Log("close");
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
GameObject.Find("LongTimeNoOpen").GetComponent<LongTimeNoOperation>().OpenCheck();
}
......
......@@ -150,7 +150,7 @@ public class StartControl : MonoBehaviour
{
Debug.unityLogger.Log("展示插屏");
yield return new WaitForSeconds(Constant.Instance.Interstitial_time);
AdUtils.showInterAd(new InterstitialAdListener(this));
AdUtils.showInterAd("InterstitialAd", new InterstitialAdListener(this));
}
private sealed class InterstitialAdListener : ZXADInterstitialListener
......@@ -166,6 +166,7 @@ public class StartControl : MonoBehaviour
public void onInterstitialClose()
{
AdManager.Instance.LoadCacheInterstitialAd("Interstitial");
startControl.StartCoroutine(startControl.SetInterAd());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment