Example #1
0
 private static void FireBannerFailedToLoad()
 {
     if (ADBannerView.onBannerFailedToLoad != null)
     {
         ADBannerView.onBannerFailedToLoad();
     }
 }
Example #2
0
        private static IntPtr Native_CreateBanner(int type, int layout)
        {
            IntPtr result;

            ADBannerView.INTERNAL_CALL_Native_CreateBanner(type, layout, out result);
            return(result);
        }
Example #3
0
 private static void FireBannerWasLoaded()
 {
     if (ADBannerView.onBannerWasLoaded != null)
     {
         ADBannerView.onBannerWasLoaded();
     }
 }
Example #4
0
 private static void FireBannerWasLoaded()
 {
     if (ADBannerView.onBannerWasLoaded == null)
     {
         return;
     }
     ADBannerView.onBannerWasLoaded();
 }
Example #5
0
 private static void FireBannerFailedToLoad()
 {
     if (ADBannerView.onBannerFailedToLoad == null)
     {
         return;
     }
     ADBannerView.onBannerFailedToLoad();
 }
Example #6
0
	// Use this for initialization
	void Start ()
	{
		DontDestroyOnLoad (gameObject);

		ad = new UnityEngine.iOS.ADBannerView (UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.Bottom);
		UnityEngine.iOS.ADBannerView.onBannerWasClicked += OnBannerWasClicked;
		UnityEngine.iOS.ADBannerView.onBannerWasLoaded += OnBannerWasLoaded;
	}
Example #7
0
 public ADBannerView(ADBannerView.Type type, ADBannerView.Layout layout)
 {
     if (ADBannerView._AlwaysFalseDummy)
     {
         ADBannerView.FireBannerWasClicked();
         ADBannerView.FireBannerWasLoaded();
     }
     this._bannerView = ADBannerView.Native_CreateBanner((int)type, (int)layout);
 }
 public void ShowBanner()
 {
     #if UNITY_IOS
     if(UnityEngine.iOS.ADBannerView.IsAvailable (UnityEngine.iOS.ADBannerView.Type.Banner)){
         Debug.Log(this.ToString () + ": App running in iOS, preparing banner.");
         banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.BottomCenter);
         banner.visible=true;
     } else {
         Debug.Log(this.ToString () + "." + UnityEngine.iOS.ADBannerView.Type.Banner.ToString () + ": is not available.");
     }
     #else
     Debug.Log(this.ToString () + ": App not running in iOS, banner will not show at all.");
     #endif
     //ADBannerView.onBannerWasLoaded += onAdLoaded;
 }
Example #9
0
    public void ShowBanner()
    {
        if (AdController.bannerInventor == AdController.ADInventor.iad)
        {
            if (banner == null)
            {
                banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.BottomCenter);
                ADBannerView.onBannerWasClicked += OnBannerClicked;
                ADBannerView.onBannerWasLoaded += OnBannerLoaded;
                banner.visible = true;
            }
            else
                banner.visible = true;
            Debug.Log("Show Adbanner");

        }
    }
Example #10
0
    void Start()
    {
        //ban = revMob.CreateBanner(0,0,350,50,null,null);
        //revMob.CreateFullscreen();
        //Debug.Log("WAIT STARTED");
        Debug.Log("Start");
        banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.Bottom);

//		ADBannerView.onBannerWasClicked += OnBannerClicked;
        UnityEngine.iOS.ADBannerView.onBannerWasLoaded += OnBannerLoaded;

        //	StartCoroutine (Check ());
        Debug.Log("Before Score");
        guitext.text = PlayerPrefs.GetFloat("Score").ToString();

        Debug.Log("After Score");
        StartCoroutine(delay());
    }
Example #11
0
    // Use this for initialization
    void Start()
    {
        if (PlayerPrefs.GetInt("noadsowned") == 1)
        {
            reklamyok = 1;
        }
        if (reklamyok == 0)
        {
            if (dontDestroy)
            {
                GameObject.DontDestroyOnLoad(gameObject);
            }

            banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, showOnTop? UnityEngine.iOS.ADBannerView.Layout.Top : UnityEngine.iOS.ADBannerView.Layout.Bottom);

            UnityEngine.iOS.ADBannerView.onBannerWasLoaded += onBannerLoaded;
        }
    }
Example #12
0
    void Start()
    {
        if (pthis != null)
        {
            Lib.DestroyObject(this);
            return;
        }

        pthis = this;

        Lib.DontDestroyOnLoad(this);

        banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.Bottom);
        UnityEngine.iOS.ADBannerView.onBannerWasClicked += OnBannerClicked;
        UnityEngine.iOS.ADBannerView.onBannerWasLoaded  += OnBannerLoaded;

        fullscreenAd = new UnityEngine.iOS.ADInterstitialAd();
        UnityEngine.iOS.ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
    }
Example #13
0
    /// <summary>
    /// Show admob banner on android (if define, please refere to ADS_INTEGRATION_DOCUMENTATION.PDF), and iAd banner on iOS
    /// </summary>
    public void ShowBanner()
    {
        if (NO_ADS)
        {
            return;
        }

                #if UNITY_IOS
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
        if (!useAdmob)
        {
                #endif
        ShowIAdBanner();
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
    }
                #endif
                #endif

                #if UNITY_IOS
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
        if (useAdmob)
        {
                #endif
                #endif
                        #if GOOGLE_MOBILE_ADS
//			if(Application.isMobilePlatform)
        {
            bannerView.LoadAd(requestBanner);
            bannerView.Show();


            bannerView.OnAdLoaded             -= HandleAdLoaded;
            bannerView.OnAdFailedToLoad       -= HandleAdFailedToLoad;
            bannerView.OnAdOpening            -= HandleAdOpened;
            bannerView.OnAdClosed             -= HandleAdClosed;
            bannerView.OnAdLeavingApplication -= HandleAdLeftApplication;



            // Called when an ad request has successfully loaded.
            bannerView.OnAdLoaded += HandleAdLoaded;
            // Called when an ad request failed to load.
            bannerView.OnAdFailedToLoad += HandleAdFailedToLoad;
            // Called when an ad is clicked.
            bannerView.OnAdOpening += HandleAdOpened;
            // Called when the user returned from the app after an ad click.
            bannerView.OnAdClosed += HandleAdClosed;
            // Called when the ad click caused the user to leave the application.
            bannerView.OnAdLeavingApplication += HandleAdLeftApplication;
//			}
                        #endif


                        #if UNITY_IOS
                        #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
    }
                        #endif
                        #endif

                #if STAN_ASSET_GOOGLEMOBILEADS
        if (!GoogleMobileAd.IsInited)
        {
            GoogleMobileAd.Init();
        }
        else
        {
            GoogleMobileAdBanner banner;

            if (registerdBanners.ContainsKey(sceneBannerId))
            {
                banner = registerdBanners [sceneBannerId];
            }
            else
            {
                banner = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.SMART_BANNER);

                registerdBanners.Add(sceneBannerId, banner);
            }

            if (banner.IsLoaded && !banner.IsOnScreen)
            {
                banner.Show();
            }
        }
                #endif

                #if STAN_ASSET_ANDROIDNATIVE
        if (!AndroidAdMobController.Instance.IsInited)
        {
            //			AndroidAdMobController.Init ();
            Set();
        }
        else
        {
            GoogleMobileAdBanner banner;

            if (registerdBanners.ContainsKey(sceneBannerId))
            {
                banner = registerdBanners [sceneBannerId];
            }
            else
            {
                banner = AndroidAdMobController.Instance.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.SMART_BANNER);

                registerdBanners.Add(sceneBannerId, banner);
            }

            if (banner.IsLoaded && !banner.IsOnScreen)
            {
                banner.Show();
            }
        }
                #endif
    }

    void ShowIAdBanner()
    {
        if (NO_ADS)
        {
            return;
        }

                #if UNITY_IOS
        CancelInvoke("ShowIAdBanner");
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
        if (!useAdmob)
        {
                #endif
        if (banner == null)
        {
            banner         = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.BottomCenter);
            banner.visible = true;
            ADBannerView.onBannerWasClicked -= OnBannerClicked;
            ADBannerView.onBannerWasLoaded  -= OnBannerLoaded;

            ADBannerView.onBannerWasClicked += OnBannerClicked;
            ADBannerView.onBannerWasLoaded  += OnBannerLoaded;

                #if !UNITY_4_6 && !UNITY_5_0 && !UNITY_5_1
            ADBannerView.onBannerFailedToLoad -= OnBannerFailedToLoad;
            ADBannerView.onBannerFailedToLoad += OnBannerFailedToLoad;
                #endif
        }
        else
        {
            banner.visible = true;
        }
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
    }
                #endif
                #endif
    }
Example #14
0
    void Start()
    {
        //ban = revMob.CreateBanner(0,0,350,50,null,null);
        //revMob.CreateFullscreen();
        //Debug.Log("WAIT STARTED");
        Debug.Log ("Start");
        banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.Bottom);

        //		ADBannerView.onBannerWasClicked += OnBannerClicked;
        UnityEngine.iOS.ADBannerView.onBannerWasLoaded  += OnBannerLoaded;

        //	StartCoroutine (Check ());
        Debug.Log ("Before Score");
        guitext.text = PlayerPrefs.GetFloat ("Score").ToString();

        Debug.Log ("After Score");
        StartCoroutine(delay());
    }
Example #15
0
 // Use this for initialization
 void Start()
 {
     banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.Top);
     UnityEngine.iOS.ADBannerView.onBannerWasClicked += OnBannerClicked;
     UnityEngine.iOS.ADBannerView.onBannerWasLoaded  += OnBannerLoaded;
 }
 public ADBannerView(ADBannerView.Type type, ADBannerView.Layout layout)
 {
   if (ADBannerView._AlwaysFalseDummy)
   {
     ADBannerView.FireBannerWasClicked();
     ADBannerView.FireBannerWasLoaded();
     ADBannerView.FireBannerFailedToLoad();
   }
   this._bannerView = ADBannerView.Native_CreateBanner((int) type, (int) layout);
 }
Example #17
0
 public static bool IsAvailable(ADBannerView.Type type)
 {
     return(ADBannerView.Native_BannerTypeAvailable((int)type));
 }
Example #18
0
 private static void Native_MoveBanner(IntPtr view, Vector2 pos)
 {
     ADBannerView.INTERNAL_CALL_Native_MoveBanner(view, ref pos);
 }
Example #19
0
 void Start()
 {
     banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top);
     ADBannerView.onBannerWasClicked += OnBannerClicked;
     ADBannerView.onBannerWasLoaded  += OnBannerLoaded;
 }
 public static bool IsAvailable(ADBannerView.Type type)
 {
   return ADBannerView.Native_BannerTypeAvailable((int) type);
 }