docs.unity3d.com
    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
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Interactions
    Syntax
    [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
    Single
    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
    Single

    Methods

    Process(ref InputInteractionContext)

    See Process(ref 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.

    Implements
    IInputInteraction.Process(ref InputInteractionContext)

    Reset()

    See IInputInteraction.Reset.

    Declaration
    public void Reset()
    Implements
    IInputInteraction.Reset()
    Back to top
    Terms of use
    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