protected override void DoCleanAd() { if (m_Config.unitID == null) { return; } MoPub.DestroyInterstitialAd(m_Config.unitID); }
protected override bool DoDestoryAD() { if (string.IsNullOrEmpty(m_ADParams.adUnitId)) { return(false); } MoPub.DestroyInterstitialAd(m_ADParams.adUnitId); m_ADState = ADState.Destory; return(true); }
private void CreateInterstitialsSection() { GUILayout.Space(_sectionMarginSize); GUILayout.Label("Interstitials"); if (!IsAdUnitArrayNullOrEmpty(_interstitialAdUnits)) { foreach (var interstitialAdUnit in _interstitialAdUnits) { GUILayout.BeginHorizontal(); GUI.enabled = !_adUnitToLoadedMapping[interstitialAdUnit] || ForceEnableButtons; if (GUILayout.Button(CreateRequestButtonLabel(interstitialAdUnit))) { Debug.Log("requesting interstitial with AdUnit: " + interstitialAdUnit); UpdateStatusLabel("Requesting " + interstitialAdUnit); MoPub.RequestInterstitialAd(interstitialAdUnit); } GUI.enabled = _adUnitToLoadedMapping[interstitialAdUnit] || ForceEnableButtons; if (GUILayout.Button("Show")) { ClearStatusLabel(); MoPub.ShowInterstitialAd(interstitialAdUnit); } GUI.enabled = _adUnitToLoadedMapping[interstitialAdUnit] || ForceEnableButtons; if (GUILayout.Button("Destroy")) { ClearStatusLabel(); MoPub.DestroyInterstitialAd(interstitialAdUnit); _adUnitToLoadedMapping[interstitialAdUnit] = false; } GUI.enabled = true; GUILayout.EndHorizontal(); } } else { GUILayout.Label("No interstitial AdUnits available", _smallerFont, null); } }