我已经在我的游戏中实现了Chartboost。广告正在显示,如果我关闭它,没有问题。如果我按下后退按钮也没问题。如果我按下广告并按下后退按钮,或者只是返回到应用程序,屏幕就会变黑。我可以听到背景音乐在播放,我仍然可以玩游戏,但显示完全是黑色的。
我使用: Unity 5.0.2f1 (64位)和CBUnityPlugin_5_5_3
我在Android 5.0.2手机和4.4.4平板电脑上进行了测试,结果是一样的。
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循环中
if (adcall)
{
variable.dieInc();
if (variable.getDie() == 3)
{
if (Chartboost.hasInterstitial(CBLocation.Default))
{
Chartboost.showInterstitial (CBLocation.Default);
}
variable.resetDie();
}
adcall = false;
}
其他人也有同样的效果吗?
期待您的回答
发布于 2016-04-05 12:18:15
我通过在Chartboost.cs脚本中注释OnGui()函数解决了同样的问题。
我希望还来得及!
https://stackoverflow.com/questions/32685468
复制相似问题