Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(196评价)
价格: 4049.00元
按老师的GoogleAdMob教程接入后游戏里没有广告横幅
上官家铭发起了问答2018-01-22
4
回复
804
浏览

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;

public class GoogleAdManager : MonoBehaviour
{
    public string adUnitId = "";
    private BannerView bannerView;
    // Use this for initialization
    void Start () {
        this.RequestBanner();
    }

    private void RequestBanner()
    {
        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
        AdRequest request = new AdRequest.Builder().Build();
        bannerView.LoadAd(request);
    }
    void Update () {
        
    }

    void OnDestroy()
    {
        bannerView.Destroy();
    }
}

 

上面是代码了,运行游戏后的提示。导出apk后在模拟器和真机上都没广告显示。也没报错

所有回复
发表回复
你还没有登录,请先 登录或 注册!