Adding in a cooldown timer
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.
Important note
For more information on Unity’s Monetization FAQs, check out https://docs.unity.com/ads/FAQ.html.
We will now implement a feature where 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, IUnityAdsShowListener { /// <summary...