Skip to main content

TimeManager

A class in Root.Township, the global namespace.

Saves and loads the world's time of day and applies the server's time speed setting to Timeline. One per scene, reached through the static instance.

Constructors​

MemberWhat it is
TimeManager()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

MemberWhat it is
static TimeManager instanceThe active time manager.

Methods​

MemberWhat it is
override void Initialize()Server: applies the time speed setting now and whenever the server config changes (skipped for entity identifier 1 or lower).
3 private and internal methods
MemberWhat it is
private void Awake()Sets instance, or destroys itself if another exists.
private void OnDestroy()Server: stops listening to server config changes.
private void UpdateSettings(Settings settings)Server: sets Timeline.Instance.TimeSpeed from the server's TimeSpeedMultiplier.