首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Unity 5 Chartboost黑屏

Unity 5 Chartboost黑屏
EN

Stack Overflow用户
提问于 2015-09-20 23:46:17
回答 1查看 289关注 0票数 0

我已经在我的游戏中实现了Chartboost。广告正在显示,如果我关闭它,没有问题。如果我按下后退按钮也没问题。如果我按下广告并按下后退按钮,或者只是返回到应用程序,屏幕就会变黑。我可以听到背景音乐在播放,我仍然可以玩游戏,但显示完全是黑色的。

我使用: Unity 5.0.2f1 (64位)和CBUnityPlugin_5_5_3

我在Android 5.0.2手机和4.4.4平板电脑上进行了测试,结果是一样的。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
bool shouldDisplayInterstitial(CBLocation location)
{
    return true;
}
void didDisplayInterstitial(CBLocation location)
{}
void didCacheInterstitial(CBLocation location)
{}
void didFailToLoadInterstitial(CBLocation location, CBImpressionError error)
{}
void didDismissInterstitial(CBLocation location)
{}
void didCloseInterstitial(CBLocation location)
{}
void didClickInterstitial(CBLocation location)
{
    Application.LoadLevel("Main_Menu");
}

void OnDisable() 
{
    Chartboost.didFailToLoadInterstitial -= didFailToLoadInterstitial;
    Chartboost.didDismissInterstitial -= didDismissInterstitial;
    Chartboost.didCloseInterstitial -= didCloseInterstitial;
    Chartboost.didClickInterstitial -= didClickInterstitial;
    Chartboost.didCacheInterstitial -= didCacheInterstitial;
    Chartboost.shouldDisplayInterstitial -= shouldDisplayInterstitial;
    Chartboost.didDisplayInterstitial -= didDisplayInterstitial;
}
void OnEnable() 
{
    Chartboost.didFailToLoadInterstitial += didFailToLoadInterstitial;
    Chartboost.didDismissInterstitial += didDismissInterstitial;
    Chartboost.didCloseInterstitial += didCloseInterstitial;
    Chartboost.didClickInterstitial += didClickInterstitial;
    Chartboost.didCacheInterstitial += didCacheInterstitial;
    Chartboost.shouldDisplayInterstitial += shouldDisplayInterstitial;
    Chartboost.didDisplayInterstitial += didDisplayInterstitial;
}

在我的update循环中

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
if (adcall)
        {
            variable.dieInc();
            if (variable.getDie() == 3)
            {
                if (Chartboost.hasInterstitial(CBLocation.Default)) 
                {
                    Chartboost.showInterstitial (CBLocation.Default);
                }
            variable.resetDie();
            }
            adcall = false;
        }

其他人也有同样的效果吗?

期待您的回答

EN

回答 1

Stack Overflow用户

发布于 2016-04-05 12:18:15

我通过在Chartboost.cs脚本中注释OnGui()函数解决了同样的问题。

我希望还来得及!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32685468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文