Skip to main content

Festivity

A class in Root.Township, the global namespace.

A seasonal event asset with a start and end date. FestivityManager turns it on and off on the server and syncs the state to clients.

Constructors​

MemberWhat it is
Festivity()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

4 private and internal fields
MemberWhat it is
private MonthDayHour endBacking field for End, the month, day and hour the festivity ends.
private bool isActiveBacking field for IsActivated. Not saved; set at run time.
private bool isEnabledBacking field for IsEnabled.
private MonthDayHour startBacking field for Start, the month, day and hour the festivity starts.

Properties​

MemberWhat it is
MonthDayHour End { get; }Month, day and hour the festivity ends.
bool IsActivated { get; set; }Whether the festivity is running now. Set by FestivityManager, which resets it from the dates every second.
bool IsEnabled { get; }Inspector switch. The server only activates enabled festivities, rechecking the dates every second.
MonthDayHour Start { get; }Month, day and hour the festivity starts.

Events​

MemberWhat it is
event Action<Festivity> ActivationChangedRaised when IsActivated changes.

Methods​

1 private and internal method
MemberWhat it is
private void SetActive(bool value)Changes the active state and raises ActivationChanged if it differs.

Used in​

Members of other types that take, return or hold a Festivity: