Click or drag to resize

InputStateExtFindFirstUp Method (InputState, InputCode)

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

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.

Namespace:  RavingBots.MultiInput
Assembly:  RavingBots.MultiInput (in RavingBots.MultiInput.dll) Version: 0.12
Syntax
C#
public static IDevice FindFirstUp(
	this InputState state,
	params InputCode[] axes
)

Parameters

state
Type: RavingBots.MultiInputInputState
InputState instance.
axes
Type: RavingBots.MultiInputInputCode
Axes to search through.

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 up PadLeftTrigger or PadRightTrigger axis that became non-zero in this frame.
var state = FindObjectOfType<InputState>();
var device = state.FindFirstUp(InputCode.PadLeftTrigger, InputCode.PadRightTrigger);
if (device != null) {
    Debug.LogFormat("Found IsUp trigger on device {0}", device.Name);
} else {
    Debug.LogFormat("IsUp trigger not found");
}
See Also