Beispiel #1
0
        IEnumerator CRInteruptWaitCheck()
        {
            yield return(new WaitForSecondsRealtime(1));

            if (FullscreenAdShowing && AdsManager.IsInstanceValid())//fix some adapter does not return Ads Close event on interrupt
            {
                if (mCurrentFullscreenAd != null)
                {
                    mCurrentFullscreenAd.OnAdAvailabilityUpdate(false);
                    mCurrentFullscreenAd = null;
                }
                if (mInterstitialAdCallback != null)
                {
                    mInterstitialAdCallback(false);
                    mInterstitialAdCallback = null;
                }
                if (mRewardAdCallback != null)
                {
                    mRewardAdCallback(false);
                    mRewardAdCallback = null;
                }
                FullscreenAdShowing  = false;
                AudioListener.volume = 1;
            }
        }
 public override void ShowAdsBanner()
 {
     base.ShowAdsBanner();
     if (mDefaultBannerAdList.Count <= 0 || !mDefaultBannerAdList[0]._Available)
     {
         return;
     }
     (mDefaultBannerAdList[0] as AdmodAdStatusHandler).bannerData.Show();
     if (AdsManager.EventOnBannerAdsChanged != null)
     {
         AdsManager.EventOnBannerAdsChanged(true);
     }
 }
Beispiel #3
0
        public override void HideAdsBanner()
        {
            base.HideAdsBanner();
            if (AdsManager.EventOnBannerAdsChanged != null)
            {
                AdsManager.EventOnBannerAdsChanged(false);
            }

            if (mDefaultBannerAdList.Count <= 0 || !mDefaultBannerAdList[0]._Available)
            {
                return;
            }
            IronSource.Agent.hideBanner();
        }
Beispiel #4
0
        public override void ShowAdsBanner()
        {
            base.ShowAdsBanner();

            if (mDefaultBannerAdList.Count <= 0 || !mDefaultBannerAdList[0]._Available)
            {
                return;
            }
            IronSource.Agent.displayBanner();
            if (AdsManager.EventOnBannerAdsChanged != null)
            {
                AdsManager.EventOnBannerAdsChanged(true);
            }
        }
Beispiel #5
0
        void HandleonInterstitialAdShowSucceededEvent()
        {
            AudioListener.volume = 0;
            FullscreenAdShowing  = true;

            if (mAdsInterstitialTimeoutThread != null)
            {
                StopCoroutine(mAdsInterstitialTimeoutThread);
                mAdsInterstitialTimeoutThread = null;
            }

            if (AdsManager.EventOnFullScreenAdsShown != null)
            {
                AdsManager.EventOnFullScreenAdsShown();
            }
        }
Beispiel #6
0
        void HandleonRewardedVideoAdOpenedEvent()
        {
            AudioListener.volume = 0;
            FullscreenAdShowing  = true;
            mHaveRewarded        = false;

            if (mAdsRewardTimeoutThread != null)
            {
                StopCoroutine(mAdsRewardTimeoutThread);
                mAdsRewardTimeoutThread = null;
            }

            if (AdsManager.EventOnFullScreenAdsShown != null)
            {
                AdsManager.EventOnFullScreenAdsShown();
            }
            //StartCoroutine(CRAdsRewardInsurance());
        }
        //protected override void AdsRequestCallback(AdsType type, bool result)
        //{
        //    switch (type)
        //    {
        //        case AdsType.Banner:
        //            break;
        //        case AdsType.Interstitial:
        //            break;
        //        case AdsType.RewardedVideo:
        //            break;
        //    }
        //}

        #region BannerAds

        void BannerAdLoadedEvent(AdmodAdStatusHandler adHandler, object sender, string message, bool success)
        {
            if (AdsManager.Debugging && mCurrentDownload != adHandler)
            {
                Debug.LogWarning("BannerAds - Return download handler is not same as current download status " + success + " current " + mCurrentDownload + "  other " + adHandler);
            }

            if (mCurrentDownload == adHandler)
            {
                AdDownloadCallback(AdsType.Banner, success, message);
            }
            else
            {
                adHandler.OnAdAvailabilityUpdate(success);
            }

            //if ((object)InternalEventOnBannerAdsChanged != null)
            //{
            //    InternalEventOnBannerAdsChanged();
            //}

            if (mBannerAdVisibility)
            {
                ShowAdsBanner();
            }
            else
            {
                if (AdsManager.EventOnBannerAdsChanged != null)
                {
                    AdsManager.EventOnBannerAdsChanged(false);
                }
                HideAdsBanner();
            }
            if (AdsManager.Debugging)
            {
                Debug.Log(success ? "BannerAds - Request Success" : ("BannerAds - Request Fail - " + message));
            }
        }