Esempio n. 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.");
     }
 }
        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);
            }
        }