Hi i have a game that displays an add when has gotten over 10 points and dies. a weird bug appeared. After getting 10 points and dying the ad will display like normally and then after closing it, another ad will appear and it will play, but then everything works like it suppose to work.
My script trigger.
if (dead)
{
if (deathCooldown <= 0) {
if (Score.score >= 10)
{
ShowAd();
}
definition
public void ShowAd()
{
if (Advertisement.IsReady())
{
Advertisement.Show("rewardedVideo", new ShowOptions(){resultCallback = HandleAdResult});
}
}
private void HandleAdResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Application.LoadLevel(Application.loadedLevel);
break;
case ShowResult.Skipped:
Application.LoadLevel(Application.loadedLevel);
break;
case ShowResult.Failed:
Debug.Log("Failed");
break;
}
}
↧