Class SphereInteractionCaster
Implementation of Interaction
Inheritance
Implements
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Interactors.Casters
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("XR/Interactors/Sphere Interaction Caster", 22)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.1/api/UnityEngine.XR.Interaction.Toolkit.Interactors.Casters.SphereInteractionCaster.html")]
public class SphereInteractionCaster : InteractionCasterBase, IInteractionCaster
Properties
castRadius
Radius of the sphere cast.
Declaration
public float castRadius { get; set; }
Property Value
Type | Description |
---|---|
float |
physicsLayerMask
Gets or sets layer mask used for limiting sphere cast and sphere overlap targets.
Declaration
public LayerMask physicsLayerMask { get; set; }
Property Value
Type | Description |
---|---|
Layer |
physicsTriggerInteraction
Determines whether the cast sphere overlap will hit triggers.
Declaration
public QueryTriggerInteraction physicsTriggerInteraction { get; set; }
Property Value
Type | Description |
---|---|
Query |
Remarks
When set to Use
Methods
InitializeCaster()
Tries to initialize the caster.
Declaration
protected override bool InitializeCaster()
Returns
Overrides
OnDisable()
See Mono
Declaration
protected virtual void OnDisable()
OnEnable()
See Mono
Declaration
protected virtual void OnEnable()
TryGetColliderTargets(XRInteractionManager, List<Collider>)
Gets an unsorted list of collider targets
Declaration
public override bool TryGetColliderTargets(XRInteractionManager interactionManager, List<Collider> targets)
Parameters
Type | Name | Description |
---|---|---|
XRInteraction |
interactionManager | XR Interaction manager reference |
List<Collider> | targets | List of target colliders to populate. |
Returns
Type | Description |
---|---|
bool | Returns true if collider targets were found. |