Click or drag to resize

InputStateExtFindFirstHeld Method (InputState)

[This is preliminary documentation and is subject to change.]

Namespace:  RavingBots.MultiInput
Assembly:  RavingBots.MultiInput (in RavingBots.MultiInput.dll) Version: 0.12
Syntax
C#
public static IDevice FindFirstHeld(
	this InputState state
)

Parameters

state
Type: RavingBots.MultiInputInputState
InputState instance.

Return Value

Type: IDevice
Found device, or null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type InputState. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Examples
The following example shows how you can use this method to find first input axis that reports non-zero value.
var state = FindObjectOfType<InputState>();
var device = state.FindFirstHeld();
if (device != null) {
    Debug.LogFormat("Found non-zero axis on device {0}", device.Name);
} else {
    Debug.LogFormat("Non-zero axis not found");
}
See Also