Skip to main content

TimeScroller

A class in Root.Township, the global namespace.

Lets a CaptainsWheel scrub the time of day: turning the wheel shifts GameTimeManager's private dayProgress by reflection.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private FieldInfo fieldInfoReflection handle for GameTimeManager.dayProgress.
private GameTimeManager timeManagerThe time manager to change.
private CaptainsWheel wheelThe wheel that drives it.

Methods​

2 private and internal methods
MemberWhat it is
private void SetTime(float oldValue, float newValue)Adds the wheel's change to the day progress, wrapped to 0 to 1.
private void Start()Subscribes to the wheel's value changes.