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 a while with a short delay that we can easily customize if we like:
- To get started, go back to the UnityAdController script and add the following new variable to it, shown in the highlighted code:
using System; // DateTime
using UnityEngine;
using UnityEngine.Advertisements; // Advertisement class
public class UnityAdController : MonoBehaviour, IUnityAdsListener
{
/// <summary>
/// If we should show ads or not
/// </summary...