Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Delay between showing Ads

Discussion in 'Scripting' started by Bartas2, Jan 4, 2016.

  1. Bartas2

    Bartas2

    Joined:
    Jan 5, 2015
    Posts:
    5
    Hi guys,
    I googled a lot, but I didn't find a solution to my problem. Does anyone of you know how to check if the time between Last watched Ad and current time is greater then 40 minutes.
    Thank you in advance!
     
  2. Bartas2

    Bartas2

    Joined:
    Jan 5, 2015
    Posts:
    5
    I've actually find a solution
    Code (CSharp):
    1.  
    2.         TimeSpan resultTimeSpan = DateTime.Now - adWatchedTime;
    3.  
    4.         Debug.Log(resultTimeSpan.TotalDays);
    5.         Debug.Log(resultTimeSpan.TotalHours);
    6.         Debug.Log(resultTimeSpan.TotalMinutes);
     
    eses likes this.