コード例 #1
0
        private void OnManagerReady(IMediationManager manager)
        {
            manager.SetAppReturnAdsEnabled(_allowReturnToPlayAd);

            if (!this) // When object are destroyed
            {
                return;
            }

            this.manager                       = manager;
            manager.OnLoadedAd                += OnInterstitialAdLoaded;
            manager.OnFailedToLoadAd          += OnInterstitialAdFailedToLoad;
            manager.OnAppReturnAdFailedToShow += OnAdFailedToShow.Invoke;
            manager.OnAppReturnAdShown        += OnAdShown.Invoke;
            manager.OnAppReturnAdClicked      += OnAdClicked.Invoke;
            manager.OnAppReturnAdClosed       += OnAdClosed.Invoke;

            try
            {
                if (manager.IsReadyAd(AdType.Interstitial))
                {
                    OnAdLoaded.Invoke();
                }
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }
        }
コード例 #2
0
 public void ChangeAppReturnState()
 {
     if (isAppReturnEnable)
     {
         appReturnStatus.text     = "DISABLED";
         appReturnButtonText.text = "ENABLE";
         manager.SetAppReturnAdsEnabled(false);
         isAppReturnEnable = false;
     }
     else
     {
         appReturnStatus.text     = "ENABLED";
         appReturnButtonText.text = "DISABLE";
         manager.SetAppReturnAdsEnabled(true);
         isAppReturnEnable = true;
     }
 }