//--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------
    public iAdBanner CreateAdBanner(TextAnchor anchor)
    {
        iAdBanner bannner = new iAdBanner(anchor, nextId);
        _banners.Add(bannner.id, bannner);

        return bannner;
    }
    public iAdBanner CreateAdBanner(int x, int y)
    {
        iAdBanner bannner = new iAdBanner(x, y, nextId);

        _banners.Add(bannner.id, bannner);

        return(bannner);
    }
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    public iAdBanner CreateAdBanner(TextAnchor anchor)
    {
        iAdBanner bannner = new iAdBanner(anchor, nextId);

        _banners.Add(bannner.id, bannner);

        return(bannner);
    }
Exemplo n.º 4
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Start()
    {
        iAdBannerController.instance.addEventListener(iAdEvent.INTERSTITIAL_AD_DID_LOAD, OnInterstisialsLoaded);
        iAdBannerController.instance.addEventListener(iAdEvent.INTERSTITIAL_AD_ACTION_DID_FINISH, OnInterstisialsFinish);

        banner1            = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerCenter);
        banner1.ShowOnLoad = true;
    }
Exemplo n.º 5
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------
    void Start()
    {
        iAdBannerController.instance.addEventListener(iAdEvent.INTERSTITIAL_AD_DID_LOAD, OnInterstisialsLoaded);
        iAdBannerController.instance.addEventListener(iAdEvent.INTERSTITIAL_AD_ACTION_DID_FINISH, OnInterstisialsFinish);

        banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerCenter);
        banner1.ShowOnLoad = true;
    }
    private void bannerViewActionShouldBegin(string bannerID)
    {
        int       id     = System.Convert.ToInt32(bannerID);
        iAdBanner banner = GetBanner(id) as iAdBanner;

        if (banner != null)
        {
            banner.bannerViewActionShouldBegin();
        }
    }
    private void bannerViewWillLoadAd(string bannerID)
    {
        int       id     = System.Convert.ToInt32(bannerID);
        iAdBanner banner = GetBanner(id) as iAdBanner;

        if (banner != null)
        {
            banner.bannerViewWillLoadAd();
        }
    }
    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    private void didFailToReceiveAdWithError(string bannerID)
    {
        int       id     = System.Convert.ToInt32(bannerID);
        iAdBanner banner = GetBanner(id) as iAdBanner;

        if (banner != null)
        {
            banner.didFailToReceiveAdWithError();
        }
    }
Exemplo n.º 9
0
 public void HideBanner()
 {
     if (registeredBanners.ContainsKey(sceneBannerId))
     {
         iAdBanner banner = registeredBanners[sceneBannerId];
         if (banner.IsLoaded)
         {
             if (banner.IsOnScreen)
             {
                 banner.Hide();
             }
         }
         else
         {
             banner.ShowOnLoad = false;
         }
     }
 }
Exemplo n.º 10
0
    //--------------------------------------
    //  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"))
        {
            iAdBannerController.instance.StartInterstitialAd();
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad"))
        {
            iAdBannerController.instance.LoadInterstitialAd();
        }


        StartX     += 170;
        GUI.enabled = IsInterstisialsAdReady;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad"))
        {
            iAdBannerController.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 = iAdBannerController.instance.CreateAdBanner(300, 100);
        }

        StartY += 80;
        StartX  = 10;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left"))
        {
            banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperLeft);
        }


        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center"))
        {
            banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperCenter);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right"))
        {
            banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperRight);
        }

        StartY += 80;
        StartX  = 10;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left"))
        {
            banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerLeft);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center"))
        {
            banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerCenter);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right"))
        {
            banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerRight);
        }


        StartY += 80;
        StartX  = 10;


        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded && banner1.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }

        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"))
        {
            iAdBannerController.instance.DestroyBanner(banner1.id);
            banner1 = null;
        }

        GUI.enabled = true;
    }
Exemplo n.º 11
0
	void OnGUI() {
		
		float StartY = 20;
		float StartX = 10;
		GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Interstitial Example", style);

		StartY+= 40;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Interstitial Ad")) {
			iAdBannerController.instance.StartInterstitialAd ();
		}

		StartX += 170;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad")) {
			iAdBannerController.instance.LoadInterstitialAd ();
		}


		StartX += 170;
		GUI.enabled = iAdBannerController.Instance.IsInterstisialsAdReady;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad")) {
			iAdBannerController.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 = iAdBannerController.instance.CreateAdBanner(300, 100);
		}

		StartY+= 80;
		StartX = 10;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left")) {
			banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperLeft);
		}


		StartX += 170;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center")) {
			banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperCenter);
		}

		StartX += 170;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right")) {
			banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperRight);
		}

		StartY+= 80;
		StartX = 10;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left")) {
			banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerLeft);
		}
		
		StartX += 170;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center")) {
			banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerCenter);
		}
		
		StartX += 170;
		if(GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right")) {
			banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerRight);
		}


		StartY+= 80;
		StartX = 10;


		GUI.enabled  = false;
		if(banner1 != null) {
			if(banner1.IsLoaded && banner1.IsOnScreen) {
				GUI.enabled  = true;
			}
		}
	
		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")) {
			ISN_Logger.Log("Destroy banner with ID: " + banner1.id);
			iAdBannerController.instance.DestroyBanner(banner1.id);
			banner1 = null;

		}

		GUI.enabled  = true;

	}
    public iAdBanner CreateAdBanner(int x, int y)
    {
        iAdBanner bannner = new iAdBanner(x, y, nextId);
        _banners.Add(bannner.id, bannner);

        return bannner;
    }
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------
    void Start()
    {
        //iAdBannerController.instance.addEventListener(iAdEvent.INTERSTITIAL_AD_DID_LOAD, OnInterstisialsLoaded);
        //iAdBannerController.instance.addEventListener(iAdEvent.INTERSTITIAL_AD_ACTION_DID_FINISH, OnInterstisialsFinish);

        InitStyles();

        float StartY = 20;
        float StartX = 10;

        StartY+= 80;
        StartX = 10;
        banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperLeft);
        banner1.Show();
    }
Exemplo n.º 14
0
 public void CreateBottomCenterBanner()
 {
     banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.LowerCenter);
 }
Exemplo n.º 15
0
 public void CreateTopCenterBanner()
 {
     Debug.Log("TOP CENTER BANNER IS ABOUT TO BE CREATED AND VISIBLE ON SCREEN");
     banner1 = iAdBannerController.instance.CreateAdBanner(TextAnchor.UpperCenter);
     Debug.Log("TOP CENTER BANNER WAS CREATED AND SHOULD BE VISIBLE ON SCREEN");
 }