Struct InputInteractionContext | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputInteractionContext

    Information passed to IInputInteraction when their associated controls trigger.

    Namespace: UnityEngine.InputSystem
    Syntax
    public struct InputInteractionContext

    Properties

    action

    The action associated with the binding.

    Declaration
    public InputAction action { get; }
    Property Value
    Type Description
    InputAction
    Remarks

    If the binding is not associated with an action, this is null.

    continuous

    If true, action is set to continuous mode (continuous).

    Declaration
    public bool continuous { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    In continuous mode, an action, while triggered, is expected to be performed even if there is no associated input in a given frame.

    control

    The bound control that changed its state to trigger the binding associated with the interaction.

    Declaration
    public InputControl control { get; }
    Property Value
    Type Description
    InputControl

    isStarted

    True if the interaction has been started.

    Declaration
    public bool isStarted { get; }
    Property Value
    Type Description
    System.Boolean
    See Also
    Started
    Started()

    isWaiting

    True if the interaction is waiting for input

    Declaration
    public bool isWaiting { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    By default, an interaction will return this this phase after every time it has been performed (Performed). This can be changed by using PerformedAndStayStarted() or PerformedAndStayPerformed().

    See Also
    Waiting

    phase

    Declaration
    public InputActionPhase phase { get; }
    Property Value
    Type Description
    InputActionPhase

    startTime

    Declaration
    public double startTime { get; }
    Property Value
    Type Description
    System.Double

    time

    Time stamp of the input event that caused control to trigger a change in the state of action.

    Declaration
    public double time { get; }
    Property Value
    Type Description
    System.Double
    See Also
    time

    timerHasExpired

    Declaration
    public bool timerHasExpired { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Canceled()

    Declaration
    public void Canceled()

    ControlIsActuated(Single)

    Return true if the control that triggered the interaction has been actuated beyond the given threshold.

    Declaration
    public bool ControlIsActuated(float threshold = 0F)
    Parameters
    Type Name Description
    System.Single threshold

    Threshold that must be reached for the control to be considered actuated. If this is zero, the threshold must be exceeded. If it is any positive value, the value must be at least matched.

    Returns
    Type Description
    System.Boolean

    True if the trigger control is actuated.

    See Also
    IsActuated(InputControl, System.Single)

    PerformedAndGoBackToWaiting()

    Declaration
    public void PerformedAndGoBackToWaiting()

    PerformedAndStayPerformed()

    Declaration
    public void PerformedAndStayPerformed()

    PerformedAndStayStarted()

    Declaration
    public void PerformedAndStayStarted()

    ReadValue<TValue>()

    Declaration
    public TValue ReadValue<TValue>()
        where TValue : struct
    Returns
    Type Description
    TValue
    Type Parameters
    Name Description
    TValue

    SetTimeout(Single)

    Declaration
    public void SetTimeout(float seconds)
    Parameters
    Type Name Description
    System.Single seconds

    Started()

    Declaration
    public void Started()

    Waiting()

    Declaration
    public void Waiting()

    See Also

    Process(InputInteractionContext)
    In This Article
    • Properties
      • action
      • continuous
      • control
      • isStarted
      • isWaiting
      • phase
      • startTime
      • time
      • timerHasExpired
    • Methods
      • Canceled()
      • ControlIsActuated(Single)
      • PerformedAndGoBackToWaiting()
      • PerformedAndStayPerformed()
      • PerformedAndStayStarted()
      • ReadValue<TValue>()
      • SetTimeout(Single)
      • Started()
      • Waiting()
    • See Also
    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