来自Unity中AdMob的奖励视频-加载速度太慢 [英] Rewarded video from AdMob in Unity - loading so slow

查看:348
本文介绍了来自Unity中AdMob的奖励视频-加载速度太慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前,我是在使用统一广告制作的游戏中使用Unity Ads来展示插页式广告和奖励广告,但是现在我改用Google Ads(AdMob)。

Previously I used Unity Ads to display interstitial and rewarded ads in my game made with unity but now I'm switching to Google Ads (AdMob).

我读过此处和下一个在这里,似乎一切正常,但是有点慢。

I read documentation from here and next from here and everything seems like it's working, but kinda slow.

I有3个场景:


  • 主菜单

  • 游戏

  • 商店

我需要在游戏和商店场景中显示奖励广告。在游戏场景中,用户可以观看广告以继续其死去的地方。他只有 5秒钟来做到这一点。如果他不观看广告,则可以观看另外25个金币的广告,重新启动游戏或进入主菜单。在主菜单场景中,用户可以去商店购买更多的角色,并且在这里,如果他观看奖励广告,他还可以使用+25个硬币的按钮。因此,奖励广告有3个位置。

I need to display rewarded ads in Game and Shop scenes. In the Game scene, the user has the ability to watch an ad to continue where he dies. He have only 5 sec to do that. If he doesn't watch an ad, then he has the ability to watch another ad for +25 coins, to restart the game or to go to the main menu. From the Main Menu scene, the user has the ability to go to the store to buy some more characters and here he also has a button for +25 coins if he watches rewarded ad. So, there are 3 places for the rewarded ad.

在主菜单脚本的 Start()中方法有:

In the Main Menu script, in the Start() method there is:

MobileAds.Initialize(appId);

问题是,当用户单击主菜单场景中的存储按钮时,我正在调用的 Start()方法

The problem is, when the user clicks on the "Store" button in the Main Menu scene, in the Start() method I'm calling

// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the rewarded video ad with the request.
rewardBasedVideo.LoadAd(request, adUnitId);

,用户可以立即点击查看广告按钮,该操作是:

and the user has the ability to immediately click on "View ad" button which does this:

if (rewardBasedVideo.IsLoaded()) {
  rewardBasedVideo.Show();
}

,这是一个问题...奖励广告仍未加载,它将在调用 rewardBasedVideo.LoadAd(request,adUnitId); 1.5秒-2秒后加载,因此用户必须多次单击它,直到出现广告。

and there is a problem... Rewarded ad is still not loaded, it will be loaded after 1.5s - 2 s from calling rewardBasedVideo.LoadAd(request, adUnitId); So, the user must click it multiple times until ad appears.

我检查了很多其他使用AdMob的游戏,每个游戏都会立即显示广告。怎么样?有什么方法可以预加载奖励广告?

I checked a lot of other games which uses AdMob and every game immediately show ads. How? Is there a way to preload rewarded ad?

当死模出现并且用户有5秒钟观看奖励广告直到他完全死亡时,这也是一个糟糕的UX。广告在约3秒后可用。

It's also a bad UX when die modal appears and user have 5s to watch rewarded ad until he is "fully dead" but the ad is available after ~3s.

在商店中,观看广告后,用户也可以再次观看广告,因此在 OnAdClosed 我输入了相同的逻辑来加载新广告,但是它也很慢,几秒钟后实际上就加载了广告,并且我测试了其他游戏-他们没有这个问题。

Also in the store, after watching the ad, user has ability to watch it again, so in OnAdClosed I putted the same logic for loading new ad but it's also slow and after few seconds the ad is actually loaded and I tested other games - they don't have that problem.

您有什么建议吗?

推荐答案

您需要致电

rewardBasedVideo.LoadAd(request, adUnitId);

应用启动后。
这将在提示用户观看广告时加载并准备广告。

As soon as the app launches. This will load and prepare the ad for when the user is prompted to watch it.

我通常有一个空的游戏对象,其中包含一个名为 AdManager的脚本,加载广告。它具有对自身的静态引用(单一模式),因此我可以从其他脚本中轻松调用它。

I ussually have an empty gameobject with a script called "AdManager" which loads the ad. It has a static reference to itself (singleton pattern) so i can easilly call it from other scripts.

这样,当应用启动时,广告就准备好了,当我想显示它时,我可以从任何地方调用它。

That way when the app launches, the ad is prepared and when I want to display it, i can call it from wherever i want to.

关于在前一个结束后显示一个新的。除了物理上必须等到加载它以外,我看不到其他可行的选择。 (请记住,广告在数据中可能很大)

Regarding displaying a new one after the previous one has ended. I do not see a viable option other than physically having to wait untill it is loaded. (Keep in mind that an Ad can be pretty big in Data)

这篇关于来自Unity中AdMob的奖励视频-加载速度太慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆