docs.unity3d.com
    目次を表示する/隠す

    Class InputExtensions

    Various useful extension methods.

    Inheritance
    Object
    InputExtensions
    Namespace: UnityEngine.InputSystem
    Syntax
    public static class InputExtensions

    Methods

    IsActive(TouchPhase)

    Return true if the given phase is Began, Moved, or Stationary, i.e. if a touch with that phase would indicate an ongoing touch.

    Declaration
    public static bool IsActive(this TouchPhase phase)
    Parameters
    Type Name Description
    TouchPhase phase

    A touch phase.

    Returns
    Type Description
    Boolean

    True if the phase indicates a touch that is ongoing.

    See Also
    phase

    IsEndedOrCanceled(TouchPhase)

    Return true if the given phase is Canceled or Ended, i.e. if a touch with that phase would no longer be ongoing.

    Declaration
    public static bool IsEndedOrCanceled(this TouchPhase phase)
    Parameters
    Type Name Description
    TouchPhase phase

    A touch phase.

    Returns
    Type Description
    Boolean

    True if the phase indicates a touch that has ended.

    See Also
    phase

    IsInProgress(InputActionPhase)

    Return true if the given phase is Started or Performed.

    Declaration
    public static bool IsInProgress(this InputActionPhase phase)
    Parameters
    Type Name Description
    InputActionPhase phase

    An action phase.

    Returns
    Type Description
    Boolean

    True if the phase is started or performed.

    See Also
    phase

    IsModifierKey(Key)

    Check if a Key enum value represents a modifier key.

    Declaration
    public static bool IsModifierKey(this Key key)
    Parameters
    Type Name Description
    Key key

    The key enum value you want to check.

    Returns
    Type Description
    Boolean

    true if key represents a modifier key, else false.

    Remarks

    Modifier keys are any keys you can hold down to modify the output of other keys pressed simultaneously, such as the "shift" or "control" keys.

    IsTextInputKey(Key)

    Check if a Key enum value represents key generating text input.

    Declaration
    public static bool IsTextInputKey(this Key key)
    Parameters
    Type Name Description
    Key key

    The key enum value you want to check.

    Returns
    Type Description
    Boolean

    true if key represents a key generating non-whitespace text input, else false.

    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)