Story & Timeline

I am making an airport game. And want to have like a clock where you can see the time.

But of course the time is going a lot faster then the normal world. How to make such thing? I would like to store the time in a class. And have it updated? Like every 30 secunds, 1 hour is passed. We only show the hours and day, so i don't need to show the minutes.

Anyone who can help me?

You can access the time from game startup via the Time.time property. You could then establish a real time to game time conversion factor (in your example, game time would flow 120 times faster than real time).

int gameTime = (int)(120 * Time.time);
int gameTimeHour = (gameTime / 3600) % 24;
int gameTimeDay = gameTime / (3600 * 24);

To have something update on an occasional basis, use InvokeRepeating:

function Start () {
    // Make PrintTime run immediately and then every 30 seconds
    InvokeRepeating("PrintTime", 0, 30);
}

function PrintTime () {
    print ("The time is now: " + Time.time);
}

You would put it in the update() function