Admob bannerview loadrequest 调用导致游戏闪烁或混蛋
Admob bannerview loadrequest call cause game flickers or jerk
我想通过两个最好的广告网络 AdMob 和 Chartboost 尽可能有效地通过我的新游戏获利。我早些时候在显示插页式广告时遇到了延迟和类似问题。为避免这种情况,我在尝试展示之前预加载了 admob 和缓存的 cb 插页式广告。它在一定程度上起到了作用,我可以看到改进。
但问题出在 AdMob 横幅上。正如我在上一个问题中提到的那样,由于我每次进入游戏屏幕时都会销毁并创建横幅视图,所以我可以看到我的游戏闪烁了一会儿。这是因为横幅视图 LoadRequest() 触发器。
在另一个线程中调用 Admob LoadRequest 解决这个问题?
如果是这样,如何在unity5的单独线程中触发Admob bannerview loadrequest?
更新:
// Create a 320x50 banner at the top of the screen.
BannerView 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);
最好将此实现放在 StartCoroutine() 中。例如,
StartCoroutine(createBannerView());
IEnumerator createBannerView() {
yield return new WaitForEndOfFrame();
// Create a 320x50 banner at the top of the screen.
BannerView 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);
}
要解决您的闪烁问题,请务必在进入游戏区域之前调用此方法。我认为 LoadRequest 不会导致任何闪烁的东西,因为这些网络调用通常发生在后台并且不会中断 Update() 或 FixedUpdate()。
我想通过两个最好的广告网络 AdMob 和 Chartboost 尽可能有效地通过我的新游戏获利。我早些时候在显示插页式广告时遇到了延迟和类似问题。为避免这种情况,我在尝试展示之前预加载了 admob 和缓存的 cb 插页式广告。它在一定程度上起到了作用,我可以看到改进。
但问题出在 AdMob 横幅上。正如我在上一个问题中提到的那样,由于我每次进入游戏屏幕时都会销毁并创建横幅视图,所以我可以看到我的游戏闪烁了一会儿。这是因为横幅视图 LoadRequest() 触发器。
在另一个线程中调用 Admob LoadRequest 解决这个问题?
如果是这样,如何在unity5的单独线程中触发Admob bannerview loadrequest?
更新:
// Create a 320x50 banner at the top of the screen.
BannerView 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);
最好将此实现放在 StartCoroutine() 中。例如,
StartCoroutine(createBannerView());
IEnumerator createBannerView() {
yield return new WaitForEndOfFrame();
// Create a 320x50 banner at the top of the screen.
BannerView 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);
}
要解决您的闪烁问题,请务必在进入游戏区域之前调用此方法。我认为 LoadRequest 不会导致任何闪烁的东西,因为这些网络调用通常发生在后台并且不会中断 Update() 或 FixedUpdate()。