Skip to main content

MenuGameSetting<T>

An abstract class in Root.Township, Alta.Menu.

Base for one setting row in the in-game settings panel, showing a setting of type T. Client only. Hides itself if the setting isn't valid on this platform.

Constructors​

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

Fields​

MemberWhat it is
protected TextRenderer displayNameTextText that shows the setting's display name.
protected T settingToDisplayThe setting this row shows. Touching the row with a hand shows its description.
1 private and internal field
MemberWhat it is
private SettingsPanel settingsPanelBacking field for SettingsPanel, the parent panel found on first use.

Properties​

MemberWhat it is
protected SettingsPanel SettingsPanel { get; }The SettingsPanel this row sits under, found on first use.

Methods​

MemberWhat it is
override void SetSettings(ISettingsFieldAccess newSettingToDisplay)Points the row at another setting and sets it up again.
protected virtual void OnValidate()Editor hook for subclasses. Empty by default.
protected virtual void Setup()Fills the row from the setting. The base writes the display name.
3 private and internal methods
MemberWhat it is
private void CheckSetup()Hides the control if its setting is not valid on this build, otherwise calls Setup.
private void OnTriggerEnter(Collider other)When a player's hand touches the control, shows the setting's description on the settings panel.
private void Start()Calls CheckSetup.