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后在模拟器和真机上都没广告显示。也没报错