Introduction
InputManager is a ScriptableObject that is used as a base class to define different managers for handling input for your system. Two managers come built-in, UnityInput and RewiredInput. You can assign an Input Manager on the Interface Manager component.
Methods#
| Name | Description |
|---|---|
| GetAxis | Returns the value of an axis |
| GetButton | True when a button has been pressed and not released |
| GetButtonDown | Returns true during the frame the user pressed down the virtual button identified by buttonName |
| GetButtonUp | Returns true the first frame the user releases the virtual button identified by buttonName |
| GetKey | Returns true while the user holds down the key identified by name |
| GetKeyDown | Returns true during the frame the user starts pressing down the key identified by name |
| GetKeyUp | Returns true during the frame the user releases the key identified by name |
| GetMousePosition | Returns the current position of the mouse |
| GetMouseButton | Returns true if the selected mouse button is currently pressed |
| GetMouseButtonDown | Returns true if the selected mouse button was pressed this frame |
| GetVector2D | Returns returns a 2D input vector |
| SetActiveMap | Sets the active input map (useful for Input System and other custom solutions |
| Initialize | Initialize the manager |