public void UtilizeBanner() { if (!this.bannerEnabled) { return; } this.bannerEnabled = false; FMLogger.vAds("utilize banner inv"); MoPubAndroid.DestroyBanner(this.bannerAdUnit); }
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); } }