How Can I Apply Ads Different Level?? I Create A 40 Level,

Ex:

follow this same pattern in further levels(40)

Code:

 public string currentscenename;

public string nextscenename;

public void Next()        //code for next level
{
int num = PlayerPrefs.GetInt("Level", 0);
Debug.Log("Num1:" + num);
num++;

PlayerPrefs.SetInt("Level", num);

if (currentscenename == nextscenename)
{
Next();
}
else
{
if (num % 4 == 3 || num % 4 == 0)         // it is working absolutely fine
{
//DebugPanel.Log("num1", "num2" + num % 4);

{
rewardBasedVideo.Show();   //this line generate reward ads
Debug.Log("rewarded 1");
}
}
if(num % 4 == 2 || num % 4 == 1)                                                                                               //1 and 2
{
DebugPanel.Log("num" , "num" + num % 4);
Debug.Log("interstitial 2");
}
}
}

**Maths:**     problem is here my condition will not be run when coming Level5 and Level10,Level15,Level20,Level25,Level30,Level35,Level40
5 mod 4 =  1
10 mod 4 = 2

Problem is when coming Level5 and Level10 then not showning ads????plz help



Referance:

• Other users might be able to help you better if you mention which Ad network you are using – Shraa1 Jul 15 at 11:40

You can use OnLevelWasLoaded(int level) but will be depreciated sometime so the docs say to subscribe to the SceneManagers sceneLoaded

using UnityEngine.SceneManagement;

{
void Start
{
}

{