Skip to main content

SettingBasedToggler

A class in Root.Township, Alta.Utilities.

Component that turns its GameObject on or off to match the current player mode and a set of expected game setting values. Client side.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private BoolSettingValue[] expectedBoolValuesBool setting values that must all hold.
private PlayerMode expectedModesPlayer modes the object is shown in. Default all.
private StringSettingValue[] expectedStringValuesString setting values that must all hold.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Subscribes to game settings changes and applies the current state.
private void OnDestroy()Unsubscribes from game settings changes.
private void UpdateValue(Settings settings)Sets the object active only if the player mode matches and every expected setting value holds.