private void CreateInterstitialsSection() { GUILayout.Space((float)this._sectionMarginSize); GUILayout.Label("Interstitials", Array.Empty <GUILayoutOption>()); if (!IsAdUnitArrayNullOrEmpty(this._interstitialAdUnits)) { foreach (string str in this._interstitialAdUnits) { GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>()); GUI.set_enabled(!this._adUnitToLoadedMapping[str]); if (GUILayout.Button(CreateRequestButtonLabel(str), Array.Empty <GUILayoutOption>())) { Debug.Log("requesting interstitial with AdUnit: " + str); this.UpdateStatusLabel("Requesting " + str); MoPubAndroid.RequestInterstitialAd(str, string.Empty, string.Empty); } GUI.set_enabled(this._adUnitToLoadedMapping[str]); if (GUILayout.Button("Show", Array.Empty <GUILayoutOption>())) { this.ClearStatusLabel(); MoPubAndroid.ShowInterstitialAd(str); } GUI.set_enabled(true); GUILayout.EndHorizontal(); } } else { GUILayout.Label("No interstitial AdUnits available", this._smallerFont, null); } }
private void CreateInterstitialsSection() { GUILayout.Space((float)this._sectionMarginSize); GUILayout.Label("Interstitials", new GUILayoutOption[0]); if (!MoPubDemoGUI.IsAdUnitArrayNullOrEmpty(this._interstitialAdUnits)) { foreach (string text in this._interstitialAdUnits) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUI.enabled = !this._adUnitToLoadedMapping[text]; if (GUILayout.Button(MoPubDemoGUI.CreateRequestButtonLabel(text), new GUILayoutOption[0])) { UnityEngine.Debug.Log("requesting interstitial with AdUnit: " + text); this._status = "Requesting " + text; MoPubAndroid.RequestInterstitialAd(text, string.Empty, string.Empty); } GUI.enabled = this._adUnitToLoadedMapping[text]; if (GUILayout.Button("Show", new GUILayoutOption[0])) { this._status = string.Empty; MoPubAndroid.ShowInterstitialAd(text); } GUI.enabled = true; GUILayout.EndHorizontal(); } } else { GUILayout.Label("No interstitial AdUnits available", this._smallerFont, null); } }
public void ShowInterstitial(AdPlacement fsPlacement) { if (!this.fsEnabled) { return; } this.fsAdPlacement = AdConfig.AdPlacementToString(fsPlacement); FMLogger.vAds("fs show inv"); MoPubAndroid.ShowInterstitialAd(this.interstitialAdUnit); this.hasLoadedInterstitial = false; AnalyticsManager.FsImpression(this.interstitialAdUnit, this.fsAdPlacement); }
public void ShowInterstitial() { UnityEngine.Debug.Log("SHOW ADS"); if (PlayerPrefsManager.GetLevel() >= firstLevel && !(adTimer < interstitialTime) && PlayerPrefsManager.GetNoAd() == 0) { if (interstitialAvailable) { lastInterstitialTime = Time.realtimeSinceStartup; adTimer = 0f; MoPubAndroid.ShowInterstitialAd(_interstitialAdUnits[0]); } else { emptyInterstitialCount++; FirebaseAnalytics.LogEvent("Empty_Interstitial", "count", emptyInterstitialCount); RequestInterstitial(); } } }