Skip to main content

ControllerModeSettings

A class in Root.Township, the global namespace.

Scriptable object listing ControllerActionModes, looked up by ControllerModeType.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private List<ControllerActionMode> modesBacking field for Modes.
private Dictionary<ControllerModeType, ControllerActionMode> modesMapBacking field for ModesMap.

Properties​

MemberWhat it is
List<ControllerActionMode> Modes { get; }All modes in the list.
Dictionary<ControllerModeType, ControllerActionMode> ModesMap { get; }Modes by type, built the first time it's read.

Methods​

MemberWhat it is
void AddMode()Adds a new empty mode to the list.
ControllerActionMode GetMode(ControllerModeType modeType)Returns the mode of the given type, or null with a warning.
ControllerActionMode GetModeAt(int index)Returns the mode at the given list index.
void RemoveMode(int indexToRemove)Removes the mode at the given index.
2 private and internal methods
MemberWhat it is
private void InitializeDictionary()Builds modesMap from the list.
private void OnValidate()Editor: logs an error if two modes share a type.

Used in​

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