docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SectorInteraction

    Interaction that performs the action if the user pushes the control into a slice of a circle along cardinal directions, with a deadzone center magnitude. Typically used to define actions for North, South, East, or West for a thumbstick.

    Inheritance
    object
    SectorInteraction
    Implements
    IInputInteraction<Vector2>
    IInputInteraction
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Interactions
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [InitializeOnLoad]
    [Preserve]
    public class SectorInteraction : IInputInteraction<Vector2>, IInputInteraction
    Remarks

    The interaction performs the action if the control crosses the center threshold defined by pressPoint and it is in a direction matching directions. Whether the action cancels or performs when leaving or re-entering each direction sector depends on the configured sweepBehavior. Once the control returns to center as defined by the center threshold, the action cancels.

    Fields

    directions

    Specifies cardinal direction(s) that, if the user moves the control in any of those directions enough to cross the press threshold, the action should be performed.

    Declaration
    public SectorInteraction.Directions directions
    Field Value
    Type Description
    SectorInteraction.Directions

    pressPoint

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

    Declaration
    public float pressPoint
    Field Value
    Type Description
    float
    Remarks

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

    See Also
    EvaluateMagnitude()

    sweepBehavior

    Determines when the action should perform or cancel when sweeping the stick around the cardinal directions without returning to center.

    Declaration
    public SectorInteraction.SweepBehavior sweepBehavior
    Field Value
    Type Description
    SectorInteraction.SweepBehavior

    Properties

    defaultPressPoint

    The default magnitude threshold that an actuated control must cross for the control to be considered pressed.

    Declaration
    public static float defaultPressPoint { get; set; }
    Property Value
    Type Description
    float

    Methods

    Process(ref InputInteractionContext)

    See UnityEngine.InputSystem.IInputInteraction.Process(ref UnityEngine.InputSystem.InputInteractionContext)

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

    Context for an interaction occuring that the input system passed here for interaction operations.

    Reset()

    See IInputInteraction.Reset.

    Declaration
    public void Reset()

    Implements

    UnityEngine.InputSystem.IInputInteraction<TValue>
    UnityEngine.InputSystem.IInputInteraction
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)