Example #1
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;
    }
Example #2
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();  // 배너 광고 출력
    }
Example #3
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();
    }
    // 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();
    }
Example #5
0
File: Ads.cs Project: GameWorthy/G1
	void Start () {

		adId = adIdAndroid;
		if (Application.platform == RuntimePlatform.IPhonePlayer) {
			adId = adIdIOS;
		}

		// 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);
		bannerView.Show ();

	}
Example #6
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 ();
    }
Example #7
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.
        AdPosition adPos = AdPosition.Bottom;
        if (Application.loadedLevelName == "LogrosScene") {
            adPos = AdPosition.Top;
        }
        bannerView = new BannerView(adUnitId, AdSize.Banner, adPos);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
        if (Application.loadedLevelName == "GameScene") {
            bannerView.Hide ();
        } else {
            bannerView.Show ();
        }
    }