InputToActionMapping
A class in Root.Township, the global namespace.
One binding from a VR input or keyboard key (with an optional second input) to a controller action, for one or both hands.
- Listed in Global namespace: I to L
- Nested types
HandType
Constructors
| Member | What it is |
|---|---|
InputToActionMapping() | Creates an InputToActionMapping with default values. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private ControllerActionType action | Backing field for Action. |
private int dpadDirection | Dpad direction for locomotion and swipe inputs, -1 when unused. |
private InputToActionMapping.HandType hand | Backing field for Hand. |
private int identifier | Backing field for Identifier. |
private bool isUsingSecondaryInput | Hidden inspector flag for whether a second input is used. |
private static Logger logger | NLog logger for this class. |
private GeneralInputType primaryInput | Main VR input. |
private KeyCode primaryInputKeyboard | Main keyboard key, used before primaryInput on desktop modes. |
private GeneralInputType secondaryInput | Second VR input. |
private KeyCode secondaryInputKeyboard | Second keyboard key. |
Properties
| Member | What it is |
|---|---|
ControllerActionType Action { get; } | The controller action this input triggers. |
InputToActionMapping.HandType Hand { get; } | Which hand the binding applies to. |
int Identifier { get; } | Random id given on creation. |
Methods
| Member | What it is |
|---|---|
override bool Equals(object obj) | True when the action, inputs, keys, hand and dpad direction all match. |
object[] GetButtonsForPlatform(PlayerMode platform) | Returns the primary and secondary input for the given player mode, or null if the primary is none. |
override int GetHashCode() | Hash of all binding fields, including the random identifier. |
override string ToString() | The action name and its key or input names. |
1 private and internal method
Used in
Members of other types that take, return or hold a InputToActionMapping: