Merhaba, Arkadaşlar elimdeki scrip reklam kodu hazır kurulu halde fakat ben bunda değişiklik yapmak istiyorum aşşağıdaki gibi bendeki kod kodun çalışırlığı her bölüm sonunda 1 sanisede reklam geliyor karşıma ama ben bunu her 5 levelde 1 veya her 5 bölüm geçememesinde 1 şeklinde ayarlamak istiyorum aşağıdaki kodu nasıl düzenlemem gerekiyor?

kod:

public void ShowAds()
{
StartCoroutine(ShowPopupAds());
}

IEnumerator ShowPopupAds()
{
yield return new WaitForSeconds(0.1f);

// TODO: check if allow to show ads
var allowShowAds = true;

if (allowShowAds == true)
{
#if UNITY_EDITOR
// Show Unity Ads for testing only
if (Advertisement.IsReady())
{
Advertisement.Show();
}
#else
// Google Ads on real devices
GoogleAdsController.instance.ShowInterstitial();
#endif
}
}