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.
Inherited Members
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
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()
Declaration
public void Reset()