Skip to main content

DPadInputSource

A class in Root.Township, the global namespace.

An InputSource that counts as pressed while the player's D-pad touch is on one direction. Built in code with a direction and PlayerInput.

Constructors​

MemberWhat it is
DPadInputSource(int direction, PlayerInput controller)Creates a DPadInputSource from direction and controller.

Fields​

1 private and internal field
MemberWhat it is
private PlayerInput playerInputThe PlayerInput whose D-pad is watched.

Properties​

MemberWhat it is
int Direction { get; }The D-pad direction this source listens for.

Methods​

MemberWhat it is
void AddListeners()Subscribes to the D-pad's TouchChanged event. Called by the constructor.
void RemoveListeners()Unsubscribes from the D-pad.
1 private and internal method
MemberWhat it is
private void KeyPressed(int direction)Fires pressed when the touch moves onto Direction and unpressed when it moves off.