我正在尝试使用Google AdMob在我的统一游戏中实现横幅广告。我已经搜索了很多解决方案,但没有人在游戏过程中显示横幅。有谁可以帮助我吗?我将在下面留下代码:
[SerializeField] private string apId = "";
[SerializeField] private string bannerId = "";
BannerView banner;
// Use this for initialization
void Start () {
MobileAds.Initialize(apId);
ShowBanner();
}
public void ShowBanner()
{
banner = new BannerView(bannerId, AdSize.Banner, AdPosition.Top);
AdRequest request = new AdRequest.Builder().Build();
banner.LoadAd(request);
}