InputState Class |
[This is preliminary documentation and is subject to change.]
Namespace: RavingBots.MultiInput
public sealed class InputState : MonoBehaviour
The InputState type exposes the following members.
Name | Description | |
---|---|---|
InputState | Initializes a new instance of the InputState class |
Name | Description | |
---|---|---|
Devices |
The list of currently active devices. Subscribe to the DeviceStateChanged event
to be notified when this list changes.
|
Name | Description | |
---|---|---|
FindFirst |
Overload of
FindFirst(InputState, IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean)
that limits the search to selected axes, given as IEnumerableT argument.
Use this form if you have a collection of input codes.
| |
Reset |
Resets the state of all axes on all devices.
|
Name | Description | |
---|---|---|
DevicesEnumerated |
Event fired after the Devices list is first populated.
Will only be fired once during the component lifetime (use DeviceStateChanged
event to get updates).
| |
DeviceStateChanged |
Event fired when the Devices list changes.
| |
LifetimeManagement |
Toggles lifetime management. If true, DontDestroyOnLoad will be called on
GameObject containing this component and extraneous instances will be automatically
destroyed. InputState must strictly outlive all device objects, so this is
necessary if you want IDevice objects to be usable after scene changes.
| |
LogLevel |
Preferred log level.
| |
UseFixedUpdate |
Switches to using FixedUpdate to drain events and poll for updates.
|
Name | Description | |
---|---|---|
FindFirst(FuncIDevice, IVirtualAxis, Boolean) | Overloaded.
Overload of
FindFirst(InputState, IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean) that
only returns the device. Use this form if you only need the device object.
(Defined by InputStateExt.) | |
FindFirst(FuncIDevice, IVirtualAxis, Boolean, InputCode) | Overloaded.
Overload of
FindFirst(InputState, IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean) that
only returns the device and limits the search to selected axes, given as params argument.
Use this form if you only need the device object and you're specifying input codes manually.
(Defined by InputStateExt.) | |
FindFirst(FuncIDevice, IVirtualAxis, Boolean, IEnumerableInputCode) | Overloaded.
Overload of
FindFirst(InputState, IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean) that
only returns the device and limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you only need the device object and you have a collection of input codes.
(Defined by InputStateExt.) | |
FindFirst(IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean) | Overloaded.
Queries all axes on all devices, and returns first for which a given predicate
returns true. If you don't require a custom predicate (i.e. you just want to check
IsHeld or similar), you should use simpler variants like
FindFirstHeld(InputState, IDevice, IVirtualAxis).
(Defined by InputStateExt.) | |
FindFirst(IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean, InputCode) | Overloaded.
Overload of
FindFirst(InputState, IDevice, IVirtualAxis, FuncIDevice, IVirtualAxis, Boolean) that
limits
the search to selected axes, given as params argument. Use this form if you're specifying input codes
manually.
(Defined by InputStateExt.) | |
FindFirstDown | Overloaded.
Overload of FindFirstDown(InputState, IDevice, IVirtualAxis) that
only returns the device. Use this form if you only need the device object.
(Defined by InputStateExt.) | |
FindFirstDown(InputCode) | Overloaded.
Overload of FindFirstDown(InputState, IDevice, IVirtualAxis) that
only returns the device and limits the search to selected axes, given as params argument.
Use this form if you only need the device object and you're specifying input codes manually.
(Defined by InputStateExt.) | |
FindFirstDown(IEnumerableInputCode) | Overloaded.
Overload of FindFirstDown(InputState, IDevice, IVirtualAxis) that
only returns the device and limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you only need the device object and you have a collection of input codes.
(Defined by InputStateExt.) | |
FindFirstDown(IDevice, IVirtualAxis) | Overloaded.
Queries all axes on all devices, and returns the first for which IsDown
is true.
(Defined by InputStateExt.) | |
FindFirstDown(IDevice, IVirtualAxis, InputCode) | Overloaded.
Overload of FindFirstDown(InputState, IDevice, IVirtualAxis) that limits
the search to selected axes, given as params argument. Use this form if you're specifying input codes
manually.
(Defined by InputStateExt.) | |
FindFirstDown(IDevice, IVirtualAxis, IEnumerableInputCode) | Overloaded.
Overload of FindFirstDown(InputState, IDevice, IVirtualAxis) that limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you have a collection of input codes.
(Defined by InputStateExt.) | |
FindFirstHeld | Overloaded.
Overload of FindFirstHeld(InputState, IDevice, IVirtualAxis) that
only returns the device. Use this form if you only need the device object.
(Defined by InputStateExt.) | |
FindFirstHeld(InputCode) | Overloaded.
Overload of FindFirstHeld(InputState, IDevice, IVirtualAxis) that
only returns the device and limits the search to selected axes, given as params argument.
Use this form if you only need the device object and you're specifying input codes manually.
(Defined by InputStateExt.) | |
FindFirstHeld(IEnumerableInputCode) | Overloaded.
Overload of FindFirstHeld(InputState, IDevice, IVirtualAxis) that
only returns the device and limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you only need the device object and you have a collection of input codes.
(Defined by InputStateExt.) | |
FindFirstHeld(IDevice, IVirtualAxis) | Overloaded.
Queries all axes on all devices, and returns the first for which IsHeld
is true.
(Defined by InputStateExt.) | |
FindFirstHeld(IDevice, IVirtualAxis, InputCode) | Overloaded.
Overload of FindFirstHeld(InputState, IDevice, IVirtualAxis) that limits
the search to selected axes, given as params argument. Use this form if you're specifying input codes
manually.
(Defined by InputStateExt.) | |
FindFirstHeld(IDevice, IVirtualAxis, IEnumerableInputCode) | Overloaded.
Overload of FindFirstHeld(InputState, IDevice, IVirtualAxis) that limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you have a collection of input codes.
(Defined by InputStateExt.) | |
FindFirstUp | Overloaded.
Overload of FindFirstUp(InputState, IDevice, IVirtualAxis) that
only returns the device. Use this form if you only need the device object.
(Defined by InputStateExt.) | |
FindFirstUp(InputCode) | Overloaded.
Overload of FindFirstUp(InputState, IDevice, IVirtualAxis) that
only returns the device and limits the search to selected axes, given as params argument.
Use this form if you only need the device object and you're specifying input codes manually.
(Defined by InputStateExt.) | |
FindFirstUp(IEnumerableInputCode) | Overloaded.
Overload of FindFirstUp(InputState, IDevice, IVirtualAxis) that
only returns the device and limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you only need the device object and you have a collection of input codes.
(Defined by InputStateExt.) | |
FindFirstUp(IDevice, IVirtualAxis) | Overloaded.
Queries all axes on all devices, and returns the first for which IsUp
is true.
(Defined by InputStateExt.) | |
FindFirstUp(IDevice, IVirtualAxis, InputCode) | Overloaded.
Overload of FindFirstUp(InputState, IDevice, IVirtualAxis) that limits
the search to selected axes, given as params argument. Use this form if you're specifying input codes
manually.
(Defined by InputStateExt.) | |
FindFirstUp(IDevice, IVirtualAxis, IEnumerableInputCode) | Overloaded.
Overload of FindFirstUp(InputState, IDevice, IVirtualAxis) that limits
the search to selected axes, given as IEnumerableT argument.
Use this form if you have a collection of input codes.
(Defined by InputStateExt.) |
Important |
---|
There should ever be only one alive instance of this component, and the instance must outlive all active IDevice objects. Having multiple active instances is unsupported and might cause issues. If you don't have special requirements you should leave LifetimeManagement set to true. |
This component initializes and controls the native code used to query the OS for state of devices and their virtual axes. All of the currently detected devices can be found through the Devices property. Additionally, you can subscribe to the DeviceStateChanged event to be notified when a new device is plugged in, or an old device is unplugged.
InputStateExt class contains a set of convenience methods for querying a range of devices on a range of axes.