Class InputMixer
A centralized input manager that gathers input from multiple InputDevices and mixes their button events and axes together.
Useful if you want to accept input from e.g. an
Inheritance
Namespace: GlitchedPolygons.Input
Assembly: UnityScriptsLibrary.dll
Syntax
public sealed class InputMixer : MonoBehaviour
Methods
| Improve this Doc View SourceGetAxis(Int32)
Gets the current value of a game axis (UNCLAMPED).
Declaration
public float GetAxis(int axisIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis to query (its integer index). |
Returns
| Type | Description |
|---|---|
| System.Single | The current value of the game axis. |
GetAxis(Int32, Vector2)
Gets the current value of a game axis (CLAMPED).
Declaration
public float GetAxis(int axisIndex, Vector2 clampRange)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis to query (its integer index). |
| Vector2 | clampRange | Range within which the axis value will be clamped (e.g. [-1;1] makes sense for directional locomotion axes). |
Returns
| Type | Description |
|---|---|
| System.Single | The current value of the game axis (usually this number is [-1;1] ) |
Events
| Improve this Doc View SourceButtonPressed
This event is raised in the frame where the player presses a button.
Which button was pressed is passed as int argument.
Declaration
public event Action<int> ButtonPressed
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |
ButtonPressedLong
This event is raised when a button has been pressed and held down for at least LONG_BUTTON_PRESS_THRESHOLD seconds.
Declaration
public event Action<int> ButtonPressedLong
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |
ButtonReleased
This event is invoked the frame when the user lets go of a button.
Which button was released is passed as int argument.
Declaration
public event Action<int> ButtonReleased
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |