0

有没有办法在 Unity 上预加载全屏广告?现在当我们使用它调用它时

revmob.ShowFullscreen(); 

当我们创建游戏结束画面时。但大多数情况下,它会在 5/10 秒后加载,如果您按下重新启动,这很可能是在游戏中,因此它会在游戏过程中显示全屏广告。

我找到了一些在原生 android 上预加载它的方法,并尝试了相同的功能来查看它们是否存在于 Unity 中,但没有运气。

谢谢。

4

3 回答 3

1

是的!您可以使用以下代码:

private RevMobFullscreen fullscreen;
fullscreen = revmob.CreateFullscreen();
fullscreen.show();

如需更多信息,可访问 RevMob 移动广告网络网站:https ://www.revmobmobileadnetwork.com

于 2014-04-30T18:00:49.550 回答
0

最好将此代码添加到 Create 语句中:

private RevMobFullscreen fullscreen;
fullscreen = revmob.CreateFullscreen();

...然后将此代码也发送给侦听器:

RevMobAdsListener revmobListener = new RevMobAdsListener() {

    // Required
    @Override
    public void onRevMobSessionIsStarted() {
        fullscreen.show();
    }

(...)
}

这将显示全屏广告。

于 2015-09-24T12:16:39.643 回答
0

您可以这样做以统一预加载 revmob 视频。但是revmob统一视频中存在内存泄漏,他们可能会在9.2.x中解决这个问题......

REVMOB_APP_IDS = new Dictionary<string, string>() {
            { "Android", androidMediaId},
            { "IOS", iosMediaId }
};
revmob = RevMob.Start (REVMOB_APP_IDS, gameObject.name);


public void SessionIsStarted ()
{
    CacheVideoInterstitial("Bootup");
}

public void CacheVideoInterstitial(string location) {
    DestroyVideo();
    StartCoroutine(CacheAfterEndofFrame(location));
}

IEnumerator CacheAfterEndofFrame(string location) {
    yield return null;
    fullscreenVideo  = revmob.CreateVideo(location);    
}

void DestroyVideo() {
    if( fullscreenVideo != null ) {
        fullscreenVideo.Hide();
        //fullscreenVideo.Release();
        //fullscreenVideo = null;
    }
}

// revmob ad closing delegate
public void UserClosedTheAd (string revMobAdType)
{
    DestroyVideo();
    CacheVideoInterstitial(this.location);  
}
于 2016-07-30T14:05:11.367 回答