Ads are great for developers; however, according to Unity's Monetization FAQs, each user is only able to view 25 ads per day. With that in mind, we will likely want to make it so that players can only trigger ads every once in a while. This also has the benefit of making players want to come back to our game after a period of time.
For more information on Unity's Monetization FAQs, check out https://unityads.unity3d.com/help/faq/monetization.
We will now program it so that our Continue option will only work once in awhile, perhaps with a short delay that we can easily customize if we'd like:
- To get started, let's dive into our UnityAdController script. We need to add a new variable to it, as you can see in the following highlighted code:
using System; // DateTime
using UnityEngine;
#if UNITY_ADS // Can only compile ad code on support platforms...