Skip to main content

PlatformActionMapping

A class in Root.Township, the global namespace.

The input-to-action mappings for one platform within a controller action mode: which buttons trigger which ControllerActionType on each hand.

Constructors​

MemberWhat it is
PlatformActionMapping()Creates a PlatformActionMapping with default values.

Fields​

4 private and internal fields
MemberWhat it is
private List<InputToActionMapping> inputToActionMappingsBacking list for AllInputToActionMappings, set in the inspector.
private Dictionary<ControllerActionType, List<object[]>> leftActionToInputMappingsBacking field for LeftActionToInputMappings.
private PlayerMode platformBacking field for Platform, the player mode these mappings are for.
private Dictionary<ControllerActionType, List<object[]>> rightActionToInputMappingsBacking field for RightActionToInputMappings.

Properties​

MemberWhat it is
List<InputToActionMapping> AllInputToActionMappings { get; }Every input to action mapping in this set.
PlatformActionMapping AllPlatformsMapping { get; set; }A shared mapping whose buttons are added to this one's results.
int MappingsCount { get; }Number of mappings.
string ModeName { get; private set; }Name of the controller mode this belongs to, set by SetupParent.
PlayerMode Platform { get; set; }The player mode (platform) these mappings are for.
ControllerModeType Type { get; private set; }The controller mode type this belongs to, set by SetupParent.
2 private and internal properties
MemberWhat it is
private Dictionary<ControllerActionType, List<object[]>> LeftActionToInputMappings { get; }Left hand lookup from action to button sets, built on first use.
private Dictionary<ControllerActionType, List<object[]>> RightActionToInputMappings { get; }Right hand lookup from action to button sets, built on first use.

Methods​

MemberWhat it is
void AddNewEmptyInputMapping()Adds a blank mapping, probably for the editor.
List<object[]> GetButtons(ControllerActionType actionType, HandIndex handIndex)The button sets bound to an action on one hand, including those from AllPlatformsMapping.
void RemoveByIdentifier(int id)Removes the mapping with the given identifier.
void SetupParent(ControllerActionMode parent)Copies the type and name from the owning controller action mode.
3 private and internal methods
MemberWhat it is
private void AddMapping(InputToActionMapping mapping, PlayerMode overridePlatform = 0)Adds a mapping to the list and files its buttons for the platform under the left, right or both hand lookups.
private void AddToButtonsArray(Dictionary<ControllerActionType, List<object[]>> dictionary, ControllerActionType actionType, object[] newButtons)Adds a button set to an action's list in a hand lookup, making the list if needed.
private void InitializeDictionaries()Builds the left and right hand lookups from every input mapping.

Used in​

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