How do i keep track of the amount of ads the player has watched, then reward the player when he has watched a certain amount of ads , e.g. 3 ads watched rewards the player the unlock of all levels or a certain amount of coins.
public Button[] lvlButtons;
void Start()
{
int levelAt = PlayerPrefs.GetInt("levelAt", 2);
for (int i = 0; i < lvlButtons.Length; i++)
{
if (i + 2 > levelAt)
lvlButtons[i].interactable = false;
}
}
This is my Code that locks levels.