Trouble with closing Unity 5 ads
I am using the ads available through Unity services in Unity 5.3.2f1, the ad is intended to show upon death of the player, the ad shows at the right time the only problem is that when the close button is pressed the ad does not close. The following code is activated when the player dies
public void CheckDead()
{
if (Ball.isDead)
{
Game_Canvas.SetActive(false);
Death_Canvas.SetActive(true);
Time.timeScale = 0f;
if(Barrier.Score > PlayerPrefs.GetInt("Highscore"))
{
PlayerPrefs.SetInt("Highscore", Barrier.Score);
}
Currentscore_Text.text = Barrier.Score.ToString();
Highscore_Text.text = PlayerPrefs.GetInt("Highscore").ToString();
}
else
{
Time.timeScale = 1f;
Game_Canvas.SetActive(true);
Death_Canvas.SetActive(false);
}
}
The code that deals with the showing of the advert is as follows;
void Update()
{
DisplayAd();
}
void DisplayAd()
{
if (Advertisement.IsReady()&&Ball.isDead)
{
Advertisement.Show();
}
}
I am suspecting it has something to do with the canvas' but I am not sure, a fix would be appreciated thank you!
Comment