Пример #1
0
        public void Load(string id, Action <SA_Result> callback)
        {
#if SA_ADMOB_INSTALLED
            m_loadCallback = callback;
            m_interstitial = new InterstitialAd(id);

            m_interstitial.OnAdLoaded       += HandleAdLoaded;
            m_interstitial.OnAdFailedToLoad += HandleAdFailedToLoad;
            m_interstitial.OnAdClosed       += HandleAdClosed;

            m_interstitial.LoadAd(UM_GoogleAdsClient.BuildAdRequest());
#endif
        }
Пример #2
0
        public void Load(string id, Action <SA_Result> callback)
        {
#if SA_ADMOB_INSTALLED
            m_loadCallback = callback;

            if (!m_isInited)
            {
                m_isInited                        = true;
                m_rewardedVideo                   = RewardBasedVideoAd.Instance;
                m_rewardedVideo.OnAdLoaded       += HandleAdLoaded;
                m_rewardedVideo.OnAdFailedToLoad += HandleAdFailedToLoad;

                m_rewardedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded;
                m_rewardedVideo.OnAdClosed   += HandleRewardBasedVideoClosed;
            }

            m_rewardedVideo.LoadAd(UM_GoogleAdsClient.BuildAdRequest(), id);
#endif
        }
Пример #3
0
        public void Load(string id, Action <SA_Result> callback)
        {
#if SA_ADMOB_INSTALLED
            AdSize size = null;
            switch (UM_GoogleAdsSettings.Instance.BannerSize)
            {
            case UM_GoogleBannerSize.Banner:
                size = AdSize.Banner;
                break;

            case UM_GoogleBannerSize.IABBanner:
                size = AdSize.IABBanner;
                break;

            case UM_GoogleBannerSize.Leaderboard:
                size = AdSize.Leaderboard;
                break;

            case UM_GoogleBannerSize.MediumRectangle:
                size = AdSize.MediumRectangle;
                break;

            case UM_GoogleBannerSize.SmartBanner:
                size = AdSize.SmartBanner;
                break;
            }

            AdPosition position = UM_GoogleAdsSettings.Instance.BannerPosition;

            m_isReady      = false;
            m_loadCallback = callback;

            m_banner = new BannerView(id, size, position);

            m_banner.OnAdLoaded       += HandleBannerLoaded;
            m_banner.OnAdFailedToLoad += HandleAdFailedToLoad;
            m_banner.OnAdOpening      += HandleBannerAdOpened;

            // Load a banner ad.
            m_banner.LoadAd(UM_GoogleAdsClient.BuildAdRequest());
#endif
        }