public void HideBanner() { if (banner != null) { banner.Hide(); } }
public void HideBanner() { #if DEBUG_INFO Debug.Log("AndroidManager: attempting to hide banner advertisement"); #endif #if UNITY_ANDROID if (adBanner != null) { adBanner.Hide(); } #endif }
public void HideBanner() { if (registerdBanners.ContainsKey(sceneBannerId)) { GoogleMobileAdBanner banner = registerdBanners[sceneBannerId]; if (banner.IsLoaded) { if (banner.IsOnScreen) { banner.Hide(); } } else { banner.ShowOnLoad = false; } } }
/// <summary> /// To hide banner (if displayed) /// </summary> public void HideBanner() { #if STAN_ASSET_GOOGLEMOBILEADS if (registerdBanners.ContainsKey(sceneBannerId)) { GoogleMobileAdBanner banner = registerdBanners[sceneBannerId]; if (banner.IsLoaded) { if (banner.IsOnScreen) { banner.Hide(); } } else { banner.ShowOnLoad = false; } } #endif #if STAN_ASSET_ANDROIDNATIVE if (registerdBanners.ContainsKey(sceneBannerId)) { GoogleMobileAdBanner banner = registerdBanners[sceneBannerId]; if (banner.IsLoaded) { if (banner.IsOnScreen) { banner.Hide(); } } else { banner.ShowOnLoad = false; } } #endif }
public void SmartBannerHide() { SmartBanner.Hide(); }
public void BannerHide() { Banner.Hide(); }
private void B2Hide() { banner2.Hide(); }
private void B1Hide() { banner1.Hide(); }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { float StartY = 20; float StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Interstisal Example", style); StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Interstitial Ad")) { GoogleMobileAd.StartInterstitialAd(); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad")) { GoogleMobileAd.LoadInterstitialAd(); } StartX += 170; GUI.enabled = IsInterstisialsAdReady; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad")) { GoogleMobileAd.ShowInterstitialAd(); } GUI.enabled = true; StartY += 80; StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banners Example", style); GUI.enabled = false; if (banner1 == null) { GUI.enabled = true; } StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Custom Pos")) { banner1 = GoogleMobileAd.CreateAdBanner(300, 100, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperLeft, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperCenter, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperRight, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerRight, GADBannerSize.BANNER); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded) { GUI.enabled = true; } } StartY += 80; StartX = 10; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh")) { banner1.Refresh(); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Move To Center")) { banner1.SetBannerPosition(TextAnchor.MiddleCenter); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "To Radom Coords")) { banner1.SetBannerPosition(Random.Range(0, Screen.width), Random.Range(0, Screen.height)); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded && banner1.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide")) { banner1.Hide(); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded && !banner1.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show")) { banner1.Show(); } GUI.enabled = false; if (banner1 != null) { GUI.enabled = true; } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy")) { GoogleMobileAd.DestroyBanner(banner1.id); banner1 = null; } GUI.enabled = true; StartY += 80; StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banner 2", style); GUI.enabled = false; if (banner2 == null) { GUI.enabled = true; } StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Smart Banner")) { banner2 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.SMART_BANNER); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh")) { banner2.Refresh(); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded && banner2.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide")) { banner2.Hide(); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded && !banner2.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show")) { banner2.Show(); } GUI.enabled = false; if (banner2 != null) { GUI.enabled = true; } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy")) { GoogleMobileAd.DestroyBanner(banner2.id); banner2 = null; } GUI.enabled = true; }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { float StartY = 20; float StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Interstisal Example", style); StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Interstitial Ad")) { AndroidAdMobController.Instance.StartInterstitialAd(); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad")) { AndroidAdMobController.Instance.LoadInterstitialAd(); } StartX += 170; GUI.enabled = IsInterstisialsAdReady; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad")) { AndroidAdMobController.Instance.ShowInterstitialAd(); } GUI.enabled = true; StartY += 80; StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banners Example", style); GUI.enabled = false; if (banner1 == null) { GUI.enabled = true; } StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Custom Pos")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(300, 100, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.UpperLeft, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.UpperCenter, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.UpperRight, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right")) { banner1 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.LowerRight, GADBannerSize.BANNER); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded) { GUI.enabled = true; } } StartY += 80; StartX = 10; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh")) { banner1.Refresh(); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded && banner1.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide")) { banner1.Hide(); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded && !banner1.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show")) { banner1.Show(); } GUI.enabled = false; if (banner1 != null) { GUI.enabled = true; } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy")) { AndroidAdMobController.Instance.DestroyBanner(banner1.id); banner1 = null; } GUI.enabled = true; StartY += 80; StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banner 2", style); GUI.enabled = false; if (banner2 == null) { GUI.enabled = true; } StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Smart Banner")) { banner2 = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.SMART_BANNER); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh")) { banner2.Refresh(); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded && banner2.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide")) { banner2.Hide(); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded && !banner2.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show")) { banner2.Show(); } GUI.enabled = false; if (banner2 != null) { GUI.enabled = true; } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy")) { AndroidAdMobController.Instance.DestroyBanner(banner2.id); banner2 = null; } GUI.enabled = true; }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { float StartY = 20; float StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Interstisal Example", style); StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Interstitial Ad")) { GoogleMobileAd.StartInterstitialAd(); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad")) { GoogleMobileAd.LoadInterstitialAd(); } StartX += 170; GUI.enabled = IsInterstisialsAdReady; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad")) { GoogleMobileAd.ShowInterstitialAd(); } GUI.enabled = true; StartY += 80; StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banners Example", style); GUI.enabled = false; if (banner1 == null) { GUI.enabled = true; } StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Custom Pos")) { banner1 = GoogleMobileAd.CreateAdBanner(300, 100, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperLeft, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperCenter, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperRight, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.BANNER); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right")) { banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerRight, GADBannerSize.BANNER); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded) { GUI.enabled = true; } } StartY += 80; StartX = 10; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh")) { banner1.Refresh(); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Move To Center")) { banner1.SetBannerPosition(TextAnchor.MiddleCenter); } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "To Radom Coords")) { banner1.SetBannerPosition(Random.Range(0, Screen.width), Random.Range(0, Screen.height)); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded && banner1.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide")) { banner1.Hide(); } GUI.enabled = false; if (banner1 != null) { if (banner1.IsLoaded && !banner1.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show")) { banner1.Show(); } GUI.enabled = false; if (banner1 != null) { GUI.enabled = true; } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy")) { GoogleMobileAd.DestroyBanner(banner1.id); banner1 = null; } GUI.enabled = true; StartY += 80; StartX = 10; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banner 2", style); GUI.enabled = false; if (banner2 == null) { GUI.enabled = true; } StartY += 40; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Smart Banner")) { banner2 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.SMART_BANNER); //listening for banner to load example using C# actions: banner2.OnLoadedAction += OnBannerLoadedAction; //By setting this flsg to fals we will prevent banner to show when it's loaded //e will listner for OnLoadedAction event and show it by our selfs instead banner2.ShowOnLoad = false; } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh")) { banner2.Refresh(); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded && banner2.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide")) { banner2.Hide(); } GUI.enabled = false; if (banner2 != null) { if (banner2.IsLoaded && !banner2.IsOnScreen) { GUI.enabled = true; } } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show")) { banner2.Show(); } GUI.enabled = false; if (banner2 != null) { GUI.enabled = true; } StartX += 170; if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy")) { GoogleMobileAd.DestroyBanner(banner2.id); banner2 = null; } GUI.enabled = true; }
public void Hide2() { banner2.Hide(); }
public void Hide1() { banner1.Hide(); }
public void HideBanner() { banner.Hide(); }