Skip to main content

PlayerAdjustableHeightFixerSettings

A class in Root.Township, the global namespace.

Settings asset for the height assist accessibility option: a list of height offsets and the one the player has picked, saved in game settings.

  • Listed in Global namespace: P
  • Inherits or implements ScriptableObject
  • Attributes CreateAssetMenu

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private int currentHeightIndex of the selected height, -1 until set up.
private float[] heightsThe height offset options.

Properties​

MemberWhat it is
bool CanDecreaseHeight { get; }True if there is a lower height option.
bool CanIncreaseHeight { get; }True if there is a higher height option.
float Height { get; }The selected height offset.

Methods​

MemberWhat it is
void DecreaseHeight()Moves to the next lower height and saves it, only when accessibility features are on.
void IncreaseHeight()Moves to the next higher height and saves it, only when accessibility features are on.
3 private and internal methods
MemberWhat it is
private void SaveHeight()Writes the selected index to the game settings and saves them.
private void SetupHeight()On first use, loads the index from settings or falls back to the zero height option.
private void UpdateSettings(GameSettings settings)On settings change, picks the saved index, or the zero height option if accessibility features are off.

Used in​

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