示例#1
0
	public void showInterstitialAd()
	{
		try
		{
			currentAdDisplayTime = Time.time;
			float num = currentAdDisplayTime - Global.lastAdDisplayTime;
			if (interstitial != null && interstitial.IsLoaded())
			{
				interstitial.Show();
				Global.lastAdDisplayTime = currentAdDisplayTime;
			}
			else if (isLoaded)
			{
				interstitialAd.Show();
				Global.lastAdDisplayTime = currentAdDisplayTime;
			}
			else if (num > Global.backFillAdGap && Monetization.IsReady(video_ad))
			{
				ShowAdPlacementContent showAdPlacementContent = null;
				(Monetization.GetPlacementContent(video_ad) as ShowAdPlacementContent)?.Show(HandleShowResult);
			}
			else if (num > Global.backFillAdGap && IronSource.Agent.isInterstitialReady())
			{
				ShowIronAd();
				Global.lastAdDisplayTime = currentAdDisplayTime;
			}
			else if (num > Global.backFillAdGap && interstitial2 != null && interstitial2.IsLoaded())
			{
				interstitial2.Show();
				Global.lastAdDisplayTime = currentAdDisplayTime;
			}
			else if (Monetization.IsReady(rewarded_Video) || rewardLoaded)
			{
				Global.isRewardVidAvail = true;
				gm.retry.SetActive(value: true);
				gm.menu.SetActive(value: true);
				if (gm.gameFailed.activeSelf)
				{
					gm.failMenu.SetActive(value: true);
					gm.failRetry.SetActive(value: true);
				}
			}
			else
			{
				gm.retry.SetActive(value: true);
				gm.menu.SetActive(value: true);
				if (gm.gameFailed.activeSelf)
				{
					gm.failMenu.SetActive(value: true);
					gm.failRetry.SetActive(value: true);
				}
			}
		}
		catch (Exception)
		{
		}
	}
示例#2
0
 public void Show()
 {
     if (_ad.IsLoaded())
     {
         _ad.Show();
     }
 }
示例#3
0
 public void showInterstitialAd()
 {
     if (interstitial != null && interstitial.IsLoaded())
     {
         interstitial.Show();
     }
 }
示例#4
0
 public void showInterstitialAd()
 {
     hasShownAdOneTime = true;
     if (interstitial != null && interstitial.IsLoaded())
     {
         interstitial.Show();
     }
 }
示例#5
0
    void ShowInterstitial()
    {
        // Initialize an InterstitialAd.
        InterstitialAd interstitial = new InterstitialAd("ca-app-pub-9688313728956513/9454822785");
        // Create an empty ad request.
        AdRequest intrequest = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(intrequest);

        interstitial.Show ();
    }
示例#6
0
 public static void ShowAndDestroyInterstitialAd(InterstitialAd interstitial)
 {
     try
     {
         if (interstitial.IsLoaded())
         {
             interstitial.Show();
         }
     }
     catch (Exception e) { }
 }
示例#7
0
        public override IEnumerator Show(System.Action onSuccess)
        {
#if UNITY_EDITOR
            yield break;
#else
            complete = false;
            interstitial.Show();
            while (false == complete)
            {
                yield return(new WaitForSeconds(0.1f));
            }
#endif
        }
示例#8
0
 public override void loadAd()
 {
     Debug.Log("Loading AdMob");
     if (interstitialAd.IsLoaded())
     {
         interstitialAd.Show();
         currentAdIndex = (currentAdIndex + 1) % activeNetworks;
     }
     else
     {
         requestInterstitial();
         loadNextNetwork();
     }
 }
示例#9
0
 public void showInterstitialAd()
 {
     if (isLoaded)
     {
         interstitialAd.Show();
         UnityEngine.Debug.Log("SHOW AD XXX");
     }
     else if (interstitial != null && interstitial.IsLoaded())
     {
         interstitial.Show();
     }
     else
     {
         MainMenuController.UIComponents2.SetActive(value: false);
         MainMenuController.ExitPanel2.SetActive(value: true);
     }
 }