Class HoldInteraction | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class HoldInteraction

    Performs the action if the control is pressed and held for at least the set duration (which defaults to defaultHoldTime).

    Inheritance
    System.Object
    HoldInteraction
    Namespace: UnityEngine.InputSystem.Interactions
    Syntax
    public class HoldInteraction : IInputInteraction

    Fields

    duration

    Duration in seconds that the control must be pressed for the hold to register.

    Declaration
    public float duration
    Field Value
    Type Description
    System.Single
    Remarks

    If this is less than or equal to 0 (the default), defaultHoldTime is used.

    pressPoint

    Magnitude threshold that must be crossed by an actuated control for the control to be considered pressed.

    Declaration
    public float pressPoint
    Field Value
    Type Description
    System.Single
    Remarks

    If this is less than or equal to 0 (the default), defaultButtonPressPoint is used.

    See Also
    EvaluateMagnitude()

    startContinuously

    If enabled, then while the hold is in Started phase, started will be triggered every time a bound control changes value.

    Declaration
    public bool startContinuously
    Field Value
    Type Description
    System.Boolean

    Methods

    Process(ref InputInteractionContext)

    Declaration
    public void Process(ref InputInteractionContext context)
    Parameters
    Type Name Description
    InputInteractionContext context
    Implements
    IInputInteraction.Process(ref InputInteractionContext)

    Reset()

    Declaration
    public void Reset()
    Implements
    IInputInteraction.Reset()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023