コード例 #1
0
ファイル: AdsManager.cs プロジェクト: hykka/TheProject
 private void InitializeBannerAds()
 {
     if (this.GetBannerKey() != "")
     {
         this._isEnableBanner = true;
         MaxSdk.CreateBanner(this.GetBannerKey(), MaxSdkBase.BannerPosition.BottomCenter);
         this.HideBanner(false);
     }
 }
コード例 #2
0
    private void InitializeBannerAds()
    {
        // Banners are automatically sized to 320x50 on phones and 728x90 on tablets.
        // You may use the utility method `MaxSdkUtils.isTablet()` to help with view sizing adjustments.
        MaxSdk.CreateBanner(BannerAdUnitId, MaxSdkBase.BannerPosition.TopCenter);

        // Set background or background color for banners to be fully functional.
        MaxSdk.SetBannerBackgroundColor(BannerAdUnitId, Color.black);
    }
コード例 #3
0
ファイル: ADManager.cs プロジェクト: ARMY-Inc/WateringPipe
    string bannerAdUnitId = "c902bb7f304b8cf8"; // Retrieve the id from your account
#endif
    public void InitializeBannerAds()
    {
        // Banners are automatically sized to 320x50 on phones and 728x90 on tablets
        // You may use the utility method `MaxSdkUtils.isTablet()` to help with view sizing adjustments
        MaxSdk.CreateBanner(bannerAdUnitId, MaxSdkBase.BannerPosition.BottomCenter);

        // Set background or background color for banners to be fully functional
        MaxSdk.SetBannerBackgroundColor(bannerAdUnitId, Color.white);
        MaxSdk.ShowBanner(bannerAdUnitId);
    }
コード例 #4
0
 private void InitializeBannerAds()
 {
     if (this.GetBannerKey() != "")
     {
         this._isEnableBanner = true;
         MaxSdk.CreateBanner(this.GetBannerKey(), MaxSdkBase.BannerPosition.BottomCenter);
         MaxSdkCallbacks.Banner.OnAdClickedEvent += (string adUnitId, MaxSdkBase.AdInfo adInfo) => {
             this.ycManager.analyticsManager.BannerClick();
         };
         MaxSdkCallbacks.Banner.OnAdLoadedEvent += (string adUnitId, MaxSdkBase.AdInfo adInfo) => {
             this.ycManager.analyticsManager.BannerShow();
         };
         MaxSdkCallbacks.Banner.OnAdRevenuePaidEvent += (string adUnitId, MaxSdkBase.AdInfo adInfo) => {
             this.ycManager.analyticsManager.GetSession().ads_banner.Add(this.OnAdRevenuePaidEvent(adUnitId, adInfo));
         };
         if (this.ycManager.ycConfig.BannerDisplayOnInit)
         {
             this.HideBanner(false);
         }
     }
 }
コード例 #5
0
        protected override void DownloadAd(AdStatusHandler ad)
        {
            if (AdsManager.Debugging)
            {
                Debug.Log("DownloadAd " + ad._Type.ToString() + " id " + ad._Id);
            }
            base.DownloadAd(ad);
            switch (ad._Type)
            {
            case AdsType.Banner:
                MaxSdk.CreateBanner(ad._Id, AdapterBannerPosition(mBannerPosition));
                break;

            case AdsType.Interstitial:
                MaxSdk.LoadInterstitial(ad._Id);
                break;

            case AdsType.RewardedVideo:
                MaxSdk.LoadRewardedAd(ad._Id);
                break;
            }
        }
コード例 #6
0
        //------------------------------------------------------------
        // Banner Ads.
        //------------------------------------------------------------

        protected override void InternalShowBannerAd(AdPlacement placement, BannerAdPosition position, BannerAdSize size)
        {
#if EM_APPLOVIN
            string id = placement == AdPlacement.Default ?
                        mAdSettings.DefaultBannerAdId.Id :
                        FindIdForPlacement(mAdSettings.CustomBannerAdIds, placement);

            if (string.IsNullOrEmpty(id))
            {
                return;
            }

            bool shouldCreateNewBanner = true;

            if (mCreatedBanners.ContainsKey(placement) &&
                mCreatedBanners[placement].Key == position &&
                mCreatedBanners[placement].Value == size)
            {
                shouldCreateNewBanner = false;
            }

            if (shouldCreateNewBanner)
            {
                DestroyBannerAd(placement);
                MaxSdk.CreateBanner(id, ToAppLovinAdPosition(position));
                MaxSdk.SetBannerBackgroundColor(id, new Color(1, 1, 1, 0));

                if (!mCreatedBanners.ContainsKey(placement))
                {
                    mCreatedBanners.Add(placement, new KeyValuePair <BannerAdPosition, BannerAdSize>(position, size));
                }
                mCreatedBanners[placement] = new KeyValuePair <BannerAdPosition, BannerAdSize>(position, size);
            }

            MaxSdk.ShowBanner(id);
#endif
        }
コード例 #7
0
 public void InitializeBannerAds()
 {
     MaxSdk.CreateBanner(bannerAdUnitId, MaxSdkBase.BannerPosition.TopCenter);
     // Set background or background color for banners to be fully functional
     MaxSdk.SetBannerBackgroundColor(bannerAdUnitId, new Color(0, 0, 0, 0));
 }