Using a calendar in my game

Hello

I am currently trying to make a career mode in my game, in which you can simulate forward through dates. I currently have a calendar in my game, which works perfectly. I also have a simulate button that goes through a day per second and a button to stop simulating forward.

However I would like to allow the player to play events such as Tournaments and Exhibition Races. The Races would all be assigned a date to occur on. These dates are created at runtime, as is the calendar. When the date in the game = the date of the race, the race should occur. For example, say that I choose to have a Race on the 20th March. How can I make it so that as soon as the date = 20/3/16, it will Log a message in the console. A good example of what I am trying to do is the FIFA career mode simulation system, where every time you have an event on the calendar, the simulation stops.

Thank you

Dok

You could create a variable called “day” or “date”, and increment the variable as the game time goes on. Once the variable reaches 16, run an if statement. For example,

if (date == 16) {
    Debug.Log ("It's day 20!");
}