public void ShowBannerWithPos() { if (banner != null) { banner.SetPosition(AdPosition.BottomLeft); banner.Show(); } }
public void moveBannerTo(int x, int y) { if (banner != null) { banner.SetPosition(x, y); } }
public override void SyncAdPosition() { if (m_BannerView == null) { return; } if (m_AdInterface.adPosition == AdPosition.CustomDefine) { Vector2Int pos = m_AdInterface.adCustomGrid; m_BannerView.SetPosition(pos.x, pos.y); } else { m_BannerView.SetPosition(ConvertAdPosition(m_AdInterface.adPosition)); } }
public void Update() { #if UNITY_ANDROID && !UNITY_EDITOR if (initialized) { advertBanner.SetPosition(AdPosition.Bottom); } #endif }
public void _show_admob_Banner(AdPosition pos) { if (PlayerPrefs.GetInt("RemoveAds") == 0) { if (bannerView != null) { bannerView.SetPosition(pos); showBanner(); return; } bannerView = new BannerView(_admob_Banner, AdSize.Banner, AdPosition.TopLeft); bannerView.OnAdLoaded += HandleAdLoaded; bannerView.OnAdFailedToLoad += HandleAdFailedToLoad; bannerView.OnAdOpening += HandleAdOpened; bannerView.OnAdClosed += HandleAdClosed; bannerView.OnAdLeavingApplication += HandleAdLeftApplication; bannerView.LoadAd(CreateAdRequest()); } }
private void SetBannerTop() { if (Screen.dpi != 0) { bannerView.SetPosition(0, Mathf.RoundToInt(Screen.height * BANNER_GAMEPLAY_Y / (Screen.dpi / 160))); } else { bannerView.SetPosition(AdPosition.Top); } }
public void __ShowAdmobMediumRectangleBannerAt(AdPosition adPosition) { try { if (PlayerPrefs.GetInt("RemoveAds") == 0) { if (bannerView_MedRect != null) { try { bannerView_MedRect.SetPosition(adPosition); try { bannerView_MedRect.Show(); } catch (Exception) { } } catch (Exception) { } } else { try { bannerView_MedRect = new BannerView(_admob_Banner, AdSize.MediumRectangle, adPosition); bannerView_MedRect.OnAdLoaded += HandleAdLoaded; bannerView_MedRect.OnAdFailedToLoad += HandleAdFailedToLoad; bannerView_MedRect.OnAdOpening += HandleAdOpened; bannerView_MedRect.OnAdClosed += HandleAdClosed; bannerView_MedRect.OnAdLeavingApplication += HandleAdLeftApplication; bannerView_MedRect.LoadAd(CreateAdRequest()); } catch (Exception) { } } } } catch (Exception) { } }
//------------------------------------------------------------ // Banner Ads. //------------------------------------------------------------ protected override void InternalShowBannerAd(AdPlacement placement, BannerAdPosition position, BannerAdSize size) { #if EM_ADMOB string id = placement == AdPlacement.Default ? mAdSettings.DefaultBannerAdId.Id : FindIdForPlacement(mAdSettings.CustomBannerAdIds, placement); if (string.IsNullOrEmpty(id)) { Debug.Log("Attempting to show AdMob banner ad with an undefined ID at placement " + AdPlacement.GetPrintableName(placement)); return; } // If the requested banner (default or custom) doesn't exist or player request a banner with different size, create a new one and show it. // Otherwise just show the existing banner (which might be hidden before). if (placement == AdPlacement.Default) // Default banner... { if (mDefaultBanner == null || mCurrentDefaultBannerSize != size) { mDefaultBanner = CreateNewBanner(position, size, id); mCurrentDefaultBannerSize = size; Debug.Log("Creating new default banner..."); } mDefaultBanner.SetPosition(ToAdMobAdPosition(position)); mDefaultBanner.Show(); } else // Custom banner... { if (!mCustomBannerAds.ContainsKey(placement) || mCustomBannerAds[placement].Value == null || mCustomBannerAds[placement].Key != size) { mCustomBannerAds[placement] = new KeyValuePair <BannerAdSize, BannerView>(size, CreateNewBanner(position, size, id)); Debug.Log("Creating new custom banner..."); } mCustomBannerAds[placement].Value.SetPosition(ToAdMobAdPosition(position)); mCustomBannerAds[placement].Value.Show(); } #endif }
public void ShowBanner(AdPosition position) { bannerView.SetPosition(position); //// Called when an ad request has successfully loaded. //bannerView.OnAdLoaded += HandleOnAdLoaded; //// Called when an ad request failed to load. //bannerView.OnAdFailedToLoad += HandleOnAdFailedToLoad; //// Called when an ad is clicked. //bannerView.OnAdOpening += HandleOnAdOpened; //// Called when the user returned from the app after an ad click. //bannerView.OnAdClosed += HandleOnAdClosed; //// Called when the ad click caused the user to leave the application. //bannerView.OnAdLeavingApplication += HandleOnAdLeftApplication; // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); bannerView.Show(); }
public void ShowBanner(BannerPosition position = BannerPosition.Bottom) { switch (position) { case Solitaire.BannerPosition.BottomLeft: { m_BannerView.SetPosition(AdPosition.BottomLeft); break; } case Solitaire.BannerPosition.BottomRight: { m_BannerView.SetPosition(AdPosition.BottomRight); break; } case Solitaire.BannerPosition.Top: { m_BannerView.SetPosition(AdPosition.Top); break; } case Solitaire.BannerPosition.TopLeft: { m_BannerView.SetPosition(AdPosition.TopLeft); break; } case Solitaire.BannerPosition.TopRight: { m_BannerView.SetPosition(AdPosition.TopRight); break; } default: { m_BannerView.SetPosition(AdPosition.Bottom); break; } } m_BannerView.Show(); }
public void SetPosition(AdPosition position) { bannerView.SetPosition(position); }