【发布时间】:2015-09-20 23:46:17
【问题描述】:
我已在我的游戏中实施 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;
}
在我的更新循环中
if (adcall)
{
variable.dieInc();
if (variable.getDie() == 3)
{
if (Chartboost.hasInterstitial(CBLocation.Default))
{
Chartboost.showInterstitial (CBLocation.Default);
}
variable.resetDie();
}
adcall = false;
}
其他人有同样的效果吗?
期待您的回答
【问题讨论】:
-
您找到解决方案了吗?有几乎相同的问题,但不是黑屏,UI 不响应触摸,但统一活动确实响应显示退出弹出窗口的 android 后退按钮
标签: android unity3d chartboost