Beispiel #1
2
	private void RequestBanner()
	{
		#if UNITY_EDITOR
		string adUnitId = "unused";
		#elif UNITY_ANDROID
		string adUnitId = "ca-app-pub-6450638975031579/7991664041";
		#elif UNITY_IPHONE
		string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
		#else
		string adUnitId = "unexpected_platform";
		#endif
		
		// Create a smartBanner banner
		bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
		// Register for ad events.
		bannerView.AdLoaded += HandleAdLoaded;
		bannerView.AdFailedToLoad += HandleAdFailedToLoad;
		bannerView.AdOpened += HandleAdOpened;
		bannerView.AdClosing += HandleAdClosing;
		bannerView.AdClosed += HandleAdClosed;
		bannerView.AdLeftApplication += HandleAdLeftApplication;
		// Load a banner ad.
		bannerView.LoadAd(createAdRequest());

		bannerView.Hide();
	}
	void OnEnable(){
		// Destroy the banner if exists (This can happen. I don't know why)
		destroyAd();
		
		// Select the proper Ad ID by build platform
#if UNITY_ANDROID
		adUnitID = adUnitIDAndroid;
#elif UNITY_IPHONE
		adUnitID = adUnitIDIOS;
#else
		adUnitID = string.Empty;
#endif

		// Create banner
		bannerView = new BannerView(adUnitID, getAdSize(), adPosition);

		// Register for events
		bannerView.OnAdLoaded += HandleAdLoaded;
		bannerView.OnAdFailedToLoad += HandleAdFailedToLoad;
		bannerView.OnAdOpening += HandleAdOpened;
		bannerView.OnAdClosed += HandleAdClosed;
		bannerView.OnAdLeavingApplication += HandleAdLeftApplication;

        // Load the banner with the request.
        bannerView.LoadAd(getAdRequest());
	}
    /// <summary>
    /// Create a banner 
    /// </summary>
    public void RequestBanner()
    {
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
		string adUnitId = androidBanner;
#elif UNITY_IPHONE
		string adUnitId = iosBanner;
#else
		string adUnitId = "unexpected_platform";
#endif
        try
        {
            // Create a 320x50 banner at the top of the screen.
            bannerView = new BannerView(adUnitId, adSize, adPosition);
            // Create an empty ad request.
            AdRequest request = new AdRequest.Builder().Build();
            // Load the banner with the request.
            bannerView.LoadAd(request);
            // Register for ad events.
            //bannerView.AdLoaded += HandleAdLoaded;
            // bannerView.AdFailedToLoad += HandleAdFailedToLoad;
            //  bannerView.AdOpened += HandleAdOpened;
            // bannerView.AdClosing += HandleAdClosing;
            // bannerView.AdClosed += HandleAdClosed;
            //    bannerView.AdLeftApplication += HandleAdLeftApplication;
            // Load a banner ad.
            //bannerView.LoadAd(createAdRequest());
        }
        catch { }
    }
    void Start()
    {
        // Create a 250x250 banner.
        AdSize adSize = new AdSize(250, 250);
        bannerView = new BannerView(
                "ca-app-pub-8082064498416450/8145076128", adSize, AdPosition.Bottom);

        // Register for ad events.
        bannerView.AdLoaded += HandleAdLoaded;
        bannerView.AdFailedToLoad += HandleAdFailedToLoad;
        bannerView.AdOpened += HandleAdOpened;
        bannerView.AdClosing += HandleAdClosing;
        bannerView.AdClosed += HandleAdClosed;
        bannerView.AdLeftApplication += HandleAdLeftApplication;

        // Request
        AdRequest request = new AdRequest.Builder()
        .AddTestDevice(AdRequest.TestDeviceSimulator)       // Simulator.
        .AddTestDevice("3BD361B306BE5D37")  // My test device.
        .Build();

        // Load the banner
        bannerView.LoadAd(request);

        // Request the interstitial
        RequestInterstitial();
    }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        // 초기화
        // 앱아이디, 배너 사이즈, 배너 위치
        m_BannerView = new BannerView("ca-app-pub-3215701313685151/6171564220", AdSize.SmartBanner, AdPosition.Bottom);

        // 전면광고
        m_InterstitialAd = new InterstitialAd("ca-app-pub-3215701313685151/7648297427");

        // 테스트 단말기 등록
        //
        AdRequest.Builder adBuilder = new AdRequest.Builder();

        // 테스트기기가 많으면 .AddTestDevice(""). 으로 계속 추가
        AdRequest adRequst = adBuilder.AddTestDevice("3AEB4134537BE358").AddTestDevice(AdRequest.TestDeviceSimulator).Build();
        // 광고 요청
        m_BannerView.LoadAd(adRequst);
        // 광고 출력
        m_BannerView.Show();

        // 광고 요청
        m_InterstitialAd.LoadAd(adRequst);
        // 이벤트 종료후 callback함수 호출 추가
        m_InterstitialAd.AdClosed += AdCloseCallback;
    }
	private void requestNewBanner() {
		bannerView = new BannerView ("YOUR_AD_UNIT_ID", AdSize.SmartBanner, AdPosition.Bottom);
		requestBanner = new AdRequest.Builder ()
			.AddTestDevice ("<YOUR_HASHED_DEVICE_ID>") // Add a test device
				.Build ();

		bannerView.LoadAd (requestBanner); // Load the Banner
	}
Beispiel #7
0
	// Use this for initialization
	void Start () {

		bannerView = new BannerView ("ca-app-pub-1387683089487019/9667976282", AdSize.Banner, AdPosition.Bottom);
		//Debug.Log("requesting ad :)");
		AdRequest request = new AdRequest.Builder().Build();
		bannerView.LoadAd (request);

	}
Beispiel #8
0
 void ShowBanner()
 {
     BannerView bannerView = new BannerView(
         "ca-app-pub-9688313728956513/8544995983", AdSize.SmartBanner, AdPosition.Bottom);
     // Create an empty ad request.
     AdRequest adrequest = new AdRequest.Builder().Build();	// Load the banner with the request.
     bannerView.LoadAd(adrequest);
 }
Beispiel #9
0
 void Start()
 {
     // Creacion del banner
     bannerView = new BannerView("ca-app-pub-9453927455644163/4445153938", AdSize.Banner, AdPosition.Bottom);
     // Creacion de la peticion de anuncio
     request = new AdRequest.Builder().Build();
     bannerView.LoadAd(request);
     bannerView.Hide();
 }
Beispiel #10
0
 public static void RequestBanner()
 {
     // Create a 320x50 banner at the top of the screen.
     BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
     // Create an empty ad request.
     AdRequest request = new AdRequest.Builder().Build();
     // Load the banner with the request.
     bannerView.LoadAd(request);
 }
Beispiel #11
0
    // Use this for initialization
    void Awake()
    {
        bannerView = new BannerView("ca-app-pub-5325622833123971/2069584440", AdSize.SmartBanner, AdPosition.Bottom);
        AdRequest.Builder builder = new AdRequest.Builder();
        //AdRequest request = builder.AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice(SystemInfo.deviceUniqueIdentifier).Build();
        AdRequest request = builder.Build();// 실제 빌드

        bannerView.LoadAd(request); //배너 광고 요청
        bannerView.Show();  // 배너 광고 출력
    }
Beispiel #12
0
    void Awake()
    {
        // Banner
        string adUnitId = "ca-app-pub-8299109678258685/4687466858";

        AdSize adSize = new AdSize(250, 50);
        bannerView = new BannerView(adUnitId, adSize, AdPosition.Bottom);
        //bannerView.LoadAd(new AdRequest.Builder().AddTestDevice(deviceId).Build());
        bannerView.LoadAd(new AdRequest.Builder().Build());
        bannerView.Show();
    }
    void Start()
    {
        if (string.IsNullOrEmpty(c_addMobID)) return;

        bannerView = new BannerView(c_addMobID, m_type, m_postion);

        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd(request);

        HideView();
    }
Beispiel #14
0
    // Use this for initialization
    void Start()
    {
        // Create a 320x50 banner at the top of the screen.
        BannerView bannerView = new BannerView(
            "ca-app-pub-5646032163335107/7915187477", AdSize.Banner, AdPosition.Bottom);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();

        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
    // Use this for initialization
    void Start()
    {
        PlayGamesPlatform.Activate ();

        Social.localUser.Authenticate((bool success) => {

        });

        bannerView = new BannerView(bannerId, AdSize.SmartBanner, AdPosition.Top);
        bannerView.LoadAd(new AdRequest.Builder().AddKeyword("unity").Build());
        bannerView.Show();
    }
Beispiel #16
0
    void Start()
    {
        if(Application.platform == RuntimePlatform.IPhonePlayer) {
            AD_UNIT_ID = "ca-app-pub-3865236618689243/6154612613";
        }

        self = this;

        banner = new BannerView(AD_UNIT_ID, AdSize.Banner, AdPosition.Bottom);
        AdRequest request = new AdRequest.Builder().Build();
        banner.LoadAd(request);
    }
Beispiel #17
0
 public void RequestBanner()
 {
     // Create a 320x50 banner at the top of the screen.
     bannerView = new BannerView(
         BANNER_ID, AdSize.SmartBanner, AdPosition.Top);
     // Create an empty ad request.
     AdRequest request = new AdRequest.Builder()
         //.AddTestDevice("A4D94C6CCCC78F95136843C5B0579088")
         .Build();
     // Load the banner with the request.
     bannerView.LoadAd(request);
 }
    void Start()
    {
        UpdateLanguage();

        bannerView = new BannerView("ca-app-pub-5734115412286766/9250985339", AdSize.Banner, AdPosition.Bottom);
        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd(request);

        //interstitial = new InterstitialAd("ca-app-pub-5734115412286766/5423314134");
        //interstitial.AdLoaded += new System.EventHandler<System.EventArgs>((sender,e) =>{
        //    interstitial.Show();
        //});
        //AdRequest request = new AdRequest.Builder().Build();
        //interstitial.LoadAd(request);
        //if (interstitial.IsLoaded())
        //{
        //    interstitial.Show();
        //}

        Debug.Log("GmeOverScript Start");

        RawImage leftImage = GameObject.Find("/Canvas/RawImageLeft").GetComponent<RawImage>();
        RawImage rightImage = GameObject.Find("/Canvas/RawImageRight").GetComponent<RawImage>();

        // for debug data
        //PersistentObjectScript persistentScript = new PersistentObjectScript();
        //persistentScript.UpColors.Add(new Phoenix.HSB96(0, 0.5f, 0.5f));
        //persistentScript.UpColors.Add(new Phoenix.HSB96(60, 0.5f, 0.5f));
        //persistentScript.UpColors.Add(new Phoenix.HSB96(120, 0.5f, 0.5f));
        //persistentScript.UpColors.Add(new Phoenix.HSB96(180, 0.5f, 0.5f));
        //persistentScript.UpColors.Add(new Phoenix.HSB96(240, 0.5f, 0.5f));
        //persistentScript.UpColors.Reverse();

        Rect leftRect = new Rect(0, 0, 100, 261);
        Texture2D leftTexture = new Texture2D((int)leftRect.width, (int)leftRect.height);
        Texture2D rightTexture = new Texture2D((int)leftRect.width, (int)leftRect.height);
        var leftRects = leftRect.Splite(GameGlobalScript.Instance.UpColors.Count);
        leftRects.Reverse();
        for (int i = 0; i < GameGlobalScript.Instance.UpColors.Count; i++)
        {
            leftTexture.DrawSolidRect(leftRects[i], GameGlobalScript.Instance.UpColors[i]);
            rightTexture.DrawSolidRect(leftRects[i], GameGlobalScript.Instance.PickedColors[i]);
        }
        leftTexture.Apply();
        rightTexture.Apply();
        leftImage.texture = leftTexture;
        rightImage.texture = rightTexture;

        Score = GameGlobalScript.Instance.FinalScore;

        GameGlobalScript.Instance.UpColors.Clear();
        GameGlobalScript.Instance.PickedColors.Clear();
    }
	void CreatSmallBanner() {

		smallBannerBottom = new BannerView(
			GameConsts.AdIdBanner, AdSize.SmartBanner, AdPosition.Bottom );

		// Create an empty ad request.
		AdRequest request = new AdRequest.Builder()
			.Build();
		
		// Load the banner with the request.
		smallBannerBottom.LoadAd(request);

	}
Beispiel #20
0
    // Banner
    public void Request()
    {
        #if UNITY_ANDROID
        string adUnitId = "INSERT_ANDROID_BANNER_AD_UNIT_ID_HERE";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-9144026334547134/6098852008";
        #else
        string adUnitId = "ca-app-pub-9144026334547134/6098852008";
        #endif

        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd(request);
    }
	public void Ads ()
	{
		#if UNITY_ANDROID
		string adUnitId = "ca-app-pub-8112894826901791/9216328060";
		#elif UNITY_IPHONE
		string adUnitId = "ca-app-pub-8112894826901791/6194189263";
		#else
		string adUnitId = "unexpected_platform";
		#endif
		banner = new BannerView (adUnitId, AdSize.Banner, AdPosition.Bottom);
		AdRequest request = new AdRequest.Builder ().Build ();
		banner.LoadAd (request); 
		print ("load ads");
	}
    public void CreateBanner()
    {
#if UNITY_IPHONE
        BannerView bannerView = new BannerView(ios_banner_bottom, AdSize.SmartBanner, AdPosition.Bottom);
        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd(request);
#endif

#if UNITY_ANDROID
        BannerView bannerView = new BannerView(andorid_banner_bottom, AdSize.SmartBanner, AdPosition.Bottom);
        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd(request);
#endif

    }
Beispiel #23
0
    void RequestHomeBannerView()
    {
#if UNITY_ANDROID
        string adUnitID = "ca-app-pub-8295605020027148/4775531117";
#elif UNITY_IPHONE
        string adUnitID = "ca-app-pub-8295605020027148/4855719914";
#endif
        //AdSize size = new AdSize(900, 300);
        bannerHome = new BannerView(adUnitID, AdSize.Banner, AdPosition.BottomLeft);
        AdRequest request = new AdRequest.Builder().Build();
        bannerHome.LoadAd(request);
        bannerHome.AdFailedToLoad += Banner_AdFailedToLoad;
        bannerHome.Hide();

    }
Beispiel #24
0
	void Start () {

		string adId = androidAdId;
		if (Application.platform == RuntimePlatform.IPhonePlayer) {
			adId = iosAdId;
		}
		
		// Create a 320x50 banner at the top of the screen.
		bannerView = new BannerView(
			adId, AdSize.Banner, AdPosition.Bottom);
		// Create an empty ad request.
		AdRequest request = new AdRequest.Builder().Build();
		// Load the banner with the request.
		bannerView.LoadAd(request);
	}
    public void ShowBanner()
    {
        //Banner is called from InAppController when checked for in app purchase

        //Initialize AdUnitId if not set
        if (adUnitBannerId == ""){
            InitializeAdUnitId();
        }

        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitBannerId, AdSize.SmartBanner, AdPosition.Bottom);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
Beispiel #26
0
    void Start()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-1685157087617386/5409201759";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.TopLeft);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
        bannerView.Show ();
    }
Beispiel #27
0
    private void RequestBanner()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-9376068839028526/3428266296";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-9376068839028526/3428266296";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
    public void RequestBanner()
    {
        #if UNITY_ANDROID
        string adUnitId = Android_Banner;
        #elif UNITY_IPHONE
        string adUnitId = ios_Banner;
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        BannerView bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
Beispiel #29
0
    private void RequestBanner()
    {
        #if UNITY_ANDROID
        string adUnitId = "pub-3534390662369307";
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        BannerView bannerView = new BannerView(adUnitId, AdSize.MediumRectangle, AdPosition.Top);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
Beispiel #30
0
    void RequestBanner()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3826667266162758/5649393422";
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
        bannerView.Hide ();
    }