Time Options
v4.0
Gametime is designed to be flexible and handle custom time periods. At this point, it does not handle more complex scenarios, so it may be worth noting that it does not handle:
The gregorian calendar or other real-world based calendars
Leap years
Months which have different numbers of days
Years which have more or less days than the number of months * number of days per month
With those limitations in place, the system does handle quite a bit. You can set these options in the Inspector.
A value of 1
in Gametime
= 1 "in game minute". The private
float
_subCounter
is used at runtime to keep track of the amount of in-game time that has passed between each minute.
The float
secondsPerGameMinute
determines how many real-world seconds pass for each in-game minute. A value of 3.0f
means that every real-world minute, 20 in-game minutes will elapse.
1 gameTime = 1 in-game minute
Now()
and GameTime
are very similar, but return slightly different things, for different use cases.
GameTime
will return the int
_gameTime
, while Now()
returns a float
, and will include subTime
by default.
subTime
is the measurement of the seconds between in-game minutes.
Last updated