Skip to main content

ControllerActions

A class in Root.Township, the global namespace.

One hand's set of ControllerActions, one per ControllerActionType, bound to buttons by PlatformActionMappings. Owned by PlayerInput.

Constructors​

MemberWhat it is
ControllerActions(PlayerInput playerInput)Creates a ControllerActions from playerInput.

Fields​

5 private and internal fields
MemberWhat it is
private ControllerAction[] actionsAll actions, in enum order.
private Dictionary<ControllerActionType, ControllerAction> actionsMapBacking field for ActionsMap.
private List<PlatformActionMapping> activeActionMappingsBacking field for ActiveActionMappings.
private static Logger loggerNLog logger for this class.
private PlayerInput playerInputThe hand's PlayerInput this belongs to.

Properties​

MemberWhat it is
Dictionary<ControllerActionType, ControllerAction> ActionsMap { get; }Actions by type.
List<PlatformActionMapping> ActiveActionMappings { get; }Mappings currently bound.

Methods​

MemberWhat it is
void AddActionMapping(PlatformActionMapping newActionMapping)Adds a mapping's buttons to every action, on top of those already bound.
void ClearAllActionMappings()Removes all inputs and listeners from every action and clears the active mappings.
void InitializeDictionary()Creates one action per ControllerActionType, skipping the 0 value.
void RemoveActionMapping(PlatformActionMapping actionMappingToRemove)Removes one active mapping's inputs and listeners from every action.
void SetActionMapping(PlatformActionMapping newActionMapping)Replaces every action's bindings with the given mapping's buttons for this hand.

Used in​

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