Good day, it is not clear how to implement the following task: there is advertising, it should be called up in the game once a day, the next day, the next day, the advertisement is again available for viewing. That is, they clicked on the "1" button, an advertisement appeared, on the second press there will be other actions, after the new day comes, the advertisement is shown once again and so around, tell me how to implement this, I would appreciate the sample code or sources for this question .
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System; public class Day : MonoBehaviour { public Text textNow; public void CheckDate() { DateTime now = DateTime.Parse ((int)PlayerPrefs.GetString ("Session")); if (now < (int)DateTime.Now.ToString()) { textNow.text = "Можем показывать рекламу"; } else textNow.text = "Превышен лимит на день"; } public void setSaveDate() { PlayerPrefs.SetString ("Session", DateTime.Now.ToString("dd")); CheckDate (); } }