Exemplo n.º 1
0
    private IEnumerator WaitThenHideCompleteScreen()
    {
        yield return(new WaitForSeconds(1f));

        bool adShown = false;

        if (AdsController.Exists())
        {
            if (LevelsToCompleteBeforeAd <= 0)
            {
                LevelsToCompleteBeforeAd = adLevelCompleteAmount;

                // Show an interstital ad and only pause the timer if an ad actually shows, when the interstitial is closed un-pause the timer
                adShown = AdsController.Instance.ShowInterstitialAd(() =>
                {
                    // Once the ad is closed hide the completed screen
                    UIScreenController.Instance.HideOverlay(UIScreenController.CompleteScreenId, true, Tween.TweenStyle.EaseIn);
                });
            }
        }

        // If no ad was shown then hide the completed overlay right away
        if (!adShown)
        {
            UIScreenController.Instance.HideOverlay(UIScreenController.CompleteScreenId, true, Tween.TweenStyle.EaseIn);
        }
    }
Exemplo n.º 2
0
 private void OnDestroy()
 {
             #if ADMOB
     if (AdsController.Exists())
     {
         AdsController.Instance.OnAdsRemoved -= OnAdsRemoved;
     }
             #endif
 }
Exemplo n.º 3
0
    public virtual void Initialize()
    {
                #if ADMOB
        if (AdsController.Exists() && AdsController.Instance.IsBannerAdsEnabled && showBannerAd)
        {
            // Need to setup the UI so the new ad doesnt block anything
            SetupScreenToShowBannerAds();

            // Add a listener so we can remove the ad placement object if ads are removed
            AdsController.Instance.OnAdsRemoved += OnAdsRemoved;
        }
                #endif
    }
Exemplo n.º 4
0
 public virtual void OnShowing(string data)
 {
             #if ADMOB
     if (AdsController.Exists() && AdsController.Instance.IsBannerAdsEnabled)
     {
         if (showBannerAd)
         {
             AdsController.Instance.ShowBannerAd(bannerPosition);
         }
         else
         {
             AdsController.Instance.HideBannerAd();
         }
     }
             #endif
 }