Exemplo n.º 1
0
 /// <summary>
 /// Show the ChartBoost advertisment.
 /// </summary>
 /// <param name="adEvent">Ad event.</param>
 private void ChartBoostAdvertisment(AdPackage.AdEvent adEvent)
 {
                 #if CHARTBOOST_ADS
     if (adEvent.type == AdPackage.AdEvent.Type.INTERSTITIAL)
     {
         //Show chartboost Interstitial Advertisment
         chartBoostAd.ShowInterstitial();
     }
     else if (adEvent.type == AdPackage.AdEvent.Type.RewardBasedVideo)
     {
         //Show chartboost RewardBasedVideo Advertisment
         chartBoostAd.ShowRewardedVideo();
     }
                 #endif
 }
Exemplo n.º 2
0
        /// <summary>
        /// Show the Admob advertisment.
        /// </summary>
        /// <param name="adEvent">Ad event.</param>
        private void AdMobAdvertisment(AdPackage.AdEvent adEvent)
        {
                        #if GOOGLE_MOBILE_ADS
            if (adEvent.type == AdPackage.AdEvent.Type.BANNER)
            {
                //Show admob banner advertisment
                if (string.IsNullOrEmpty(admob.androidBannerAdUnitID) && string.IsNullOrEmpty(admob.IOSBannerAdUnitID))
                {
                    Debug.LogWarning("Banner AdUnit is not defined in AdMob component");
                    return;
                }

                admob.RequestBanner(adEvent.adPostion);
            }
            else if (adEvent.type == AdPackage.AdEvent.Type.INTERSTITIAL)
            {
                //Show admob Interstitial Advertisment
                if (string.IsNullOrEmpty(admob.androidInterstitialAdUnitID) && string.IsNullOrEmpty(admob.IOSInterstitialAdUnitID))
                {
                    Debug.LogWarning("Interstitial AdUnit is not defined in AdMob component");
                    return;
                }
                admob.RequestInterstitial();
            }
            else if (adEvent.type == AdPackage.AdEvent.Type.RewardBasedVideo)
            {
                if (string.IsNullOrEmpty(admob.androidRewardBasedVideoAdUnitID) && string.IsNullOrEmpty(admob.IOSRewardBasedVideoAdUnitID))
                {
                    Debug.LogWarning("RewardBasedVideo AdUnit is not defined in AdMob component");
                    return;
                }
                //Show admob RewardBasedVideo Advertisment
                admob.RequestRewardBasedVideo();
            }
                        #endif
        }