How do you manage the amount of time Ads appear in your app?

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.

This should do it, it will show ads in 2 random rounds out of 5:

//If you restart the round by reloading the Scene then make
//this 2 variables static.
int adsControl = 5;
int roundShowAds = 0;

//Make this test everytime you start a round
if(adsControl < 5)
{
	adsControl++;
}
else
{
	adsControl = 0;
	roundShowAds = Random.Range(0, 5);
}

//Encapsule in this if your ShowAds call
if(adsControl == roundShowAds || adsControl == (roundShowAds + 1) % 5)
{
	//ShowAds();
}