Ejemplo n.º 1
0
    private IEnumerator BannerHideWorkaround()
    {
        yield return(0);

        FMLogger.vAds("hide banner after req on next frame. workaround");
        MoPubAndroid.ShowBanner(this.bannerAdUnit, false);
        yield break;
    }
Ejemplo n.º 2
0
 public void HideBanner()
 {
     if (!this.bannerEnabled)
     {
         return;
     }
     FMLogger.vAds("hide banner inv");
     MoPubAndroid.ShowBanner(this.bannerAdUnit, false);
     this.bannerVisable = false;
 }
Ejemplo n.º 3
0
 public void ShowBanner()
 {
     if (!this.bannerEnabled)
     {
         return;
     }
     FMLogger.vAds("show banner inv");
     MoPubAndroid.ShowBanner(this.bannerAdUnit, true);
     this.bannerVisable = true;
     if (this.userBannerImpression)
     {
         this.userBannerImpression = false;
         AnalyticsManager.BannerImpression(this.bannerAdUnit, this.currentBannerGUID, AdsManager.Instance.IsTabletAdUnit, this.bannerPosition == MoPubBase.AdPosition.BottomCenter);
     }
 }
Ejemplo n.º 4
0
 public void ShowBanner()
 {
     if (PlayerPrefsManager.GetNoAd() == 0)
     {
         if (isBannerAtTop)
         {
             MoPubAndroid.CreateBanner(_bannerAdUnits[0], MoPubBase.AdPosition.TopCenter);
             MoPubAndroid.ShowBanner(_bannerAdUnits[0], shouldShow: true);
         }
         else
         {
             MoPubAndroid.ShowBanner(_bannerAdUnits[0], shouldShow: true);
         }
     }
 }
Ejemplo n.º 5
0
 private void onAdLoadedEvent(string adUnit, float height)
 {
     this.currentBannerGUID    = AnalyticsUtils.GenerateGUID();
     this.userBannerImpression = true;
     FMLogger.vAds("onAdLoadedEvent. height: " + height);
     if (this.bannerVisable)
     {
         this.userBannerImpression = false;
         AnalyticsManager.BannerImpression(this.bannerAdUnit, this.currentBannerGUID, AdsManager.Instance.IsTabletAdUnit, this.bannerPosition == MoPubBase.AdPosition.BottomCenter);
     }
     else
     {
         FMLogger.vAds("hide banner loaded event. workaround");
         MoPubAndroid.ShowBanner(this.bannerAdUnit, false);
     }
 }
Ejemplo n.º 6
0
 private void CreateBannersSection()
 {
     GUILayout.Space(102f);
     GUILayout.Label("Banners", new GUILayoutOption[0]);
     if (!MoPubDemoGUI.IsAdUnitArrayNullOrEmpty(this._bannerAdUnits))
     {
         foreach (string text in this._bannerAdUnits)
         {
             GUILayout.BeginHorizontal(new GUILayoutOption[0]);
             GUI.enabled = !this._adUnitToLoadedMapping[text];
             if (GUILayout.Button(MoPubDemoGUI.CreateRequestButtonLabel(text), new GUILayoutOption[0]))
             {
                 UnityEngine.Debug.Log("requesting banner with AdUnit: " + text);
                 this._status = "Requesting " + text;
                 MoPubAndroid.CreateBanner(text, MoPubBase.AdPosition.BottomCenter);
             }
             GUI.enabled = this._adUnitToLoadedMapping[text];
             if (GUILayout.Button("Destroy", new GUILayoutOption[0]))
             {
                 this._status = string.Empty;
                 MoPubAndroid.DestroyBanner(text);
                 this._adUnitToLoadedMapping[text] = false;
                 this._adUnitToShownMapping[text]  = false;
             }
             GUI.enabled = (this._adUnitToLoadedMapping[text] && !this._adUnitToShownMapping[text]);
             if (GUILayout.Button("Show", new GUILayoutOption[0]))
             {
                 this._status = string.Empty;
                 MoPubAndroid.ShowBanner(text, true);
                 this._adUnitToShownMapping[text] = true;
             }
             GUI.enabled = (this._adUnitToLoadedMapping[text] && this._adUnitToShownMapping[text]);
             if (GUILayout.Button("Hide", new GUILayoutOption[0]))
             {
                 this._status = string.Empty;
                 MoPubAndroid.ShowBanner(text, false);
                 this._adUnitToShownMapping[text] = false;
             }
             GUI.enabled = true;
             GUILayout.EndHorizontal();
         }
     }
     else
     {
         GUILayout.Label("No banner AdUnits available", this._smallerFont, null);
     }
 }
Ejemplo n.º 7
0
 private void CreateBannersSection()
 {
     GUILayout.Space(102f);
     GUILayout.Label("Banners", Array.Empty <GUILayoutOption>());
     if (!IsAdUnitArrayNullOrEmpty(this._bannerAdUnits))
     {
         foreach (string str in this._bannerAdUnits)
         {
             GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>());
             GUI.set_enabled(!this._adUnitToLoadedMapping[str]);
             if (GUILayout.Button(CreateRequestButtonLabel(str), Array.Empty <GUILayoutOption>()))
             {
                 Debug.Log("requesting banner with AdUnit: " + str);
                 this.UpdateStatusLabel("Requesting " + str);
                 MoPubAndroid.CreateBanner(str, MoPubBase.AdPosition.BottomCenter);
             }
             GUI.set_enabled(this._adUnitToLoadedMapping[str]);
             if (GUILayout.Button("Destroy", Array.Empty <GUILayoutOption>()))
             {
                 this.ClearStatusLabel();
                 MoPubAndroid.DestroyBanner(str);
                 this._adUnitToLoadedMapping[str] = false;
                 this._adUnitToShownMapping[str]  = false;
             }
             GUI.set_enabled(!this._adUnitToLoadedMapping[str] ? false : !this._adUnitToShownMapping[str]);
             if (GUILayout.Button("Show", Array.Empty <GUILayoutOption>()))
             {
                 this.ClearStatusLabel();
                 MoPubAndroid.ShowBanner(str, true);
                 this._adUnitToShownMapping[str] = true;
             }
             GUI.set_enabled(!this._adUnitToLoadedMapping[str] ? false : this._adUnitToShownMapping[str]);
             if (GUILayout.Button("Hide", Array.Empty <GUILayoutOption>()))
             {
                 this.ClearStatusLabel();
                 MoPubAndroid.ShowBanner(str, false);
                 this._adUnitToShownMapping[str] = false;
             }
             GUI.set_enabled(true);
             GUILayout.EndHorizontal();
         }
     }
     else
     {
         GUILayout.Label("No banner AdUnits available", this._smallerFont, null);
     }
 }
Ejemplo n.º 8
0
 public void HideBanner()
 {
     MoPubAndroid.ShowBanner(_bannerAdUnits[0], shouldShow: false);
 }