コード例 #1
0
 public void ShowInterstitial()
 {
     if (manager.IsReadyAd(AdType.Interstitial))
     {
         manager.ShowAd(AdType.Interstitial);
     }
     else
     {
         Debug.LogError("Interstitial Ad are not ready. Please try again later.");
     }
 }
コード例 #2
0
        private void OnManagerReady(IMediationManager manager)
        {
            if (!this) // When object are destroyed
            {
                return;
            }

            this.manager                          = manager;
            manager.OnLoadedAd                   += OnInterstitialAdLoaded;
            manager.OnFailedToLoadAd             += OnInterstitialAdFailedToLoad;
            manager.OnInterstitialAdFailedToShow += OnAdFailedToShow.Invoke;
            manager.OnInterstitialAdShown        += OnAdShown.Invoke;
            manager.OnInterstitialAdClicked      += OnAdClicked.Invoke;
            manager.OnInterstitialAdClosed       += OnAdClosed.Invoke;

            try
            {
                if (manager.IsReadyAd(AdType.Interstitial))
                {
                    OnAdLoaded.Invoke();
                }
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }
        }