An abstract class in Root.Township, the global namespace.
Base for one button-like input on a controller (see ControllerInput). It holds pressed state, notes when it changed, and raises pressed and released events.
Constructors
| Member | What it is |
|---|
protected InputSource() | Creates an InputSource with default values. |
Fields
| Member | What it is |
|---|
protected bool state | Backing field for State. |
Properties
| Member | What it is |
|---|
bool IsChanged { get; private set; } | True if the last EventSet changed the state. |
bool State { get; set; } | True while pressed. |
Events
Methods
| Member | What it is |
|---|
void Event(PlayerInput controller) | Raises Pressed or Unpressed depending on the current state. |
void EventSet(InputSource source) | Copies the state from another input and records whether it changed. |
void OnInputEnded(PlayerInput controller) | Raises InputEnded. |
void OnInputStarted(PlayerInput controller) | Raises InputStarted. |
void OnPressed(PlayerInput controller) | Raises Pressed. |
void OnUnpressed(PlayerInput controller) | Raises Unpressed. |
protected virtual void InternalEventSet(InputSource source) | Hook for subclasses to copy extra data in EventSet. |
Used in
Members of other types that take, return or hold a InputSource: