private void RequestBanner() { if (PlayerPrefsManager.GetNoAd() == 1) { HideBanner(); } else { MoPubAndroid.CreateBanner(_bannerAdUnits[0], MoPubBase.AdPosition.BottomCenter); } }
public void RequestBanner() { if (!this.bannerEnabled) { return; } MoPubAndroid.CreateBanner(this.bannerAdUnit, this.bannerPosition); if (!this.bannerVisable) { this.coroutineProxy(this.BannerHideWorkaround()); } FMLogger.vAds("start banner request"); }
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); } } }
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); } }
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); } }