void Awake() { if (instance == null) { DontDestroyOnLoad(this.gameObject); instance = this; #if UNITY_EDITOR Debug.Log("AdmobBanner created - Admob Plugin only work on real device, not in editor"); return; #endif AdSize adSize = null; switch (AdvertisementSize) { case AdSizeEnum.Banner: adSize = AdSize.Banner; break; case AdSizeEnum.IabBanner: adSize = AdSize.IABBanner; break; case AdSizeEnum.LeaderBoard: adSize = AdSize.Leaderboard; break; case AdSizeEnum.MediumRectangle: adSize = AdSize.MediumRectangle; break; case AdSizeEnum.SmartBanner: adSize = AdSize.SmartBanner; break; default: adSize = AdSize.SmartBanner; break; } VNTIS_GMA_Connector.RequestBanner(BannerAdUnitID, TestDeviceIds, ShowOnLoad, adSize, AdvertisementPosition); } else { Destroy(this.gameObject); } }
void initializeInterstitial() { #if UNITY_EDITOR Debug.Log("AdmobInterstitial created - Admob Plugin only work on real device, not in editor"); return; #endif VNTIS_GMA_Connector.RequestInterstitial(InterstitialAdUnitID, TestDeviceIds, ShowInterstitialOnLoad); }
public void hideBanner() { if (VNTIS_GMA_Connector.bannerView != null) { VNTIS_GMA_Connector.hideBanner(); } else { Debug.LogError("Hide - Null"); } }
public void showBanner() { if (VNTIS_GMA_Connector.bannerView != null) { VNTIS_GMA_Connector.showBanner(); } else { Debug.LogError("Show - Null"); } }
/// <summary> /// Show the interstitial. Load if ad is not loaded, and show after load. /// </summary> public void showInterstitial() { VNTIS_GMA_Connector.RequestInterstitial(InterstitialAdUnitID, TestDeviceIds, true); }
public void loadInterstitialAd() { VNTIS_GMA_Connector.RequestInterstitial(InterstitialAdUnitID, TestDeviceIds, false); }