Class SectorInteraction
Interaction that performs the action if the control is pushed 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.
Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Interactions
Syntax
public class SectorInteraction : IInputInteraction<Vector2>
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
Determines cardinal direction(s) that the action should perform when crossing the press threshold towards.
Declaration
public SectorInteraction.Directions directions
Field Value
Type | Description |
---|---|
SectorInteraction.Directions |
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 |
---|---|
Single |
Remarks
If this is less than or equal to 0 (the default), defaultPressPoint is used instead.
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 must be crossed by an actuated control for the control to be considered pressed.
Declaration
public static float defaultPressPoint { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
Process(ref InputInteractionContext)
Declaration
public void Process(ref InputInteractionContext context)
Parameters
Type | Name | Description |
---|---|---|
InputInteractionContext | context |
Reset()
Declaration
public void Reset()