Class TimeManager
Provides access to various time management functions in the game.
public static class TimeManager
- Inheritance
-
TimeManager
- Inherited Members
Fields
OnDayPass
Called when a new in-game day starts.
public static Action OnDayPass
Field Value
OnHourPass
Called when a new in-game hour starts.
public static Action OnHourPass
Field Value
OnSleepEnd
Called when the player finishes sleeping. Parameter: total minutes skipped during sleep.
public static Action<int> OnSleepEnd
Field Value
OnSleepStart
Called when the player starts sleeping.
public static Action OnSleepStart
Field Value
OnTick
Called at every tick of gametime.
public static Action OnTick
Field Value
OnWeekPass
Called when a new in-game week starts.
public static Action OnWeekPass
Field Value
Properties
CurrentDay
The current in-game day (Monday, Tuesday, etc.).
public static Day CurrentDay { get; }
Property Value
CurrentTime
The current 24-hour time (e.g., 1330 for 1:30 PM).
public static int CurrentTime { get; }
Property Value
ElapsedDays
The number of in-game days elapsed.
public static int ElapsedDays { get; }
Property Value
IsEndOfDay
Whether the game is currently at the end of the day (4:00 AM).
public static bool IsEndOfDay { get; }
Property Value
IsNight
Whether it is currently nighttime in-game.
public static bool IsNight { get; }
Property Value
NormalizedTime
The current normalized time of day (0.0 = start, 1.0 = end).
public static float NormalizedTime { get; }
Property Value
Playtime
Total playtime (in seconds).
public static float Playtime { get; }
Property Value
SleepInProgress
Whether the player is currently sleeping.
public static bool SleepInProgress { get; }
Property Value
Methods
Get24HourTimeFromMinutes(int)
Converts total minutes into 24-hour time format.
public static int Get24HourTimeFromMinutes(int minutes)
Parameters
minutesint
Returns
GetFormatted12HourTime()
Gets the current time formatted in 12-hour AM/PM format.
public static string GetFormatted12HourTime()
Returns
GetMinutesFrom24HourTime(int)
Converts 24-hour time to total minutes.
public static int GetMinutesFrom24HourTime(int time24h)
Parameters
time24hint
Returns
IsCurrentTimeWithinRange(int, int)
Returns true if the current time is within the specified 24-hour range.
public static bool IsCurrentTimeWithinRange(int startTime24h, int endTime24h)
Parameters
Returns
SetTime(int)
Sets the current time manually and synchronizes across the network. This can only be called by the host.
public static void SetTime(int time24h)
Parameters
time24hint