docs.unity.cn
    Show / Hide Table of Contents

    Class InputHelpers

    Helper class for different kinds of input.

    Inheritance
    Object
    InputHelpers
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public static class InputHelpers : object

    Methods

    IsPressed(InputDevice, InputHelpers.Button, out Boolean, Single)

    Checks whether button is pressed or not.

    Declaration
    public static bool IsPressed(this InputDevice device, InputHelpers.Button button, out bool isPressed, float pressThreshold = null)
    Parameters
    Type Name Description
    InputDevice device

    The input device.

    InputHelpers.Button button

    The button that is being checked.

    Boolean isPressed

    A boolean that will be true if button is pressed and false if not.

    Single pressThreshold

    The threshold of what defines a press.

    Returns
    Type Description
    Boolean

    Returns true if device and button are valid. Otherwise, returns false.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Wednesday, October 27, 2021