Exemplo n.º 1
0
 protected override void DoCleanAd()
 {
     if (m_Config.unitID == null)
     {
         return;
     }
     MoPub.DestroyInterstitialAd(m_Config.unitID);
 }
Exemplo n.º 2
0
 protected override bool DoDestoryAD()
 {
     if (string.IsNullOrEmpty(m_ADParams.adUnitId))
     {
         return(false);
     }
     MoPub.DestroyInterstitialAd(m_ADParams.adUnitId);
     m_ADState = ADState.Destory;
     return(true);
 }
Exemplo n.º 3
0
    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);
        }
    }