I am new to using Unity Ads, so sorry if I am a bit confused. I am currently working on a 2d game. After every round you lose, an ad shows up after you die. Instead of this, I would like for ads to show up every two rounds out of five. I was wondering if someone knew the code to make this happen. Here is the current code with the ad codes implemented in it:
void GameOver()
{
GameState = GameState.GameOver;
Advertisement.Show();
}
public void CheckGameOver(GameObject ball)
{
listBall.Remove(ball);
if (listBall.Count == 0)
{
SoundManager.Instance.PlaySound(SoundManager.Instance.gameOver);
gameOver = true;
currentTargetPoint.SetActive(false);
ParticleSystem particle = Instantiate(hitGold, currentTarget.transform.position, Quaternion.identity) as ParticleSystem;
particle.startColor = currentTarget.gameObject.GetComponent<SpriteRenderer>().color;
particle.Play();
Destroy(particle.gameObject, 1f);
Destroy(currentTarget.gameObject);
Advertisement.Show ();
GameOver();
}
}
if (!gameOver)
{
SoundManager.Instance.PlaySound(SoundManager.Instance.gameOver);
gameOver = true;
for (int i = 0; i < listBall.Count; i++)
{
listBall*.GetComponent().Exploring();*
}
currentTargetPoint.SetActive(false);
ParticleSystem particle = Instantiate(hitGold, currentTarget.transform.position, Quaternion.identity) as ParticleSystem;
particle.startColor = currentTarget.gameObject.GetComponent().color;
particle.Play();
Destroy(particle.gameObject, 1f);
Destroy(currentTarget.gameObject);
- q`*
-
Advertisement.Show();*
GameOver();
}
----------
I would like to say thank you in advance. If you need any extra photos or code, just tell me and I will get it to you.