Class TeleportationMultiAnchorVolume
An interactable that teleports the user to a specific position and/or rotation defined by one of several anchors. The volume designates a destination anchor upon first hover based on a ITeleportationVolumeAnchorFilter.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion.Teleportation
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Teleportation Multi-Anchor Volume", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.Teleportation.TeleportationMultiAnchorVolume.html")]
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public class TeleportationMultiAnchorVolume : BaseTeleportationInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRFocusInteractable, IXRInteractionStrengthInteractable, IXRInteractable, IXROverridesGazeAutoSelect, IXRReticleDirectionProvider
Properties
anchorTransforms
The transforms that represent the possible teleportation destinations.
Declaration
public List<Transform> anchorTransforms { get; }
Property Value
Type | Description |
---|---|
List<Transform> |
See Also
destinationAnchor
The transform representing the current teleportation destination. When destinationEvaluationProgress is 1, this will be one of the transforms in anchorTransforms. Otherwise, this will be null.
Declaration
public Transform destinationAnchor { get; }
Property Value
Type | Description |
---|---|
Transform |
See Also
destinationEvaluationFilter
The filter used to evaluate a teleportation destination from the list of anchors. This is the same as the destinationEvaluationFilter in destinationEvaluationSettings unless that value is null, in which case this will return an instance of FurthestTeleportationAnchorFilter.
Declaration
public ITeleportationVolumeAnchorFilter destinationEvaluationFilter { get; }
Property Value
Type | Description |
---|---|
ITeleportationVolumeAnchorFilter |
See Also
destinationEvaluationProgress
A normalized representation of the current progress towards evaluating a destination anchor, depending on destinationEvaluationSettings. This value is 0 while not hovered. If enableDestinationEvaluationDelay is true, this value will start at 0 when initiating destination evaluation (either upon first hover or when re-evaluation occurs due to pollForDestinationChange) and will increase to 1 over the course of destinationEvaluationDelayTime seconds while hovered. Otherwise, this value will be 1 while hovered. This resets to 0 after the volume creates a teleport request.
Declaration
public float destinationEvaluationProgress { get; }
Property Value
Type | Description |
---|---|
float |
See Also
destinationEvaluationSettings
Settings for how this volume evaluates a destination anchor.
Declaration
public TeleportVolumeDestinationSettingsDatumProperty destinationEvaluationSettings { get; set; }
Property Value
Type | Description |
---|---|
TeleportVolumeDestinationSettingsDatumProperty |
See Also
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
See Also
GenerateTeleportRequest(IXRInteractor, RaycastHit, ref TeleportRequest)
Automatically called upon the teleport trigger event occurring to generate the teleport request. The teleportation destination pose should be filled out.
Declaration
protected override bool GenerateTeleportRequest(IXRInteractor interactor, RaycastHit raycastHit, ref TeleportRequest teleportRequest)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The interactor that initiated the teleport trigger. |
RaycastHit | raycastHit | The ray cast hit information from the interactor. |
TeleportRequest | teleportRequest | The teleport request that should be filled out during this method call. |
Returns
Type | Description |
---|---|
bool | Returns true if the teleport request was successfully updated and should be queued. Otherwise, returns false. |
Overrides
See Also
GetAttachTransform(IXRInteractor)
Gets the Transform that serves as the attachment point for a given Interactor.
Declaration
public override Transform GetAttachTransform(IXRInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The specific Interactor as context to get the attachment point for. |
Returns
Type | Description |
---|---|
Transform | Returns the attachment point Transform. |
Overrides
Remarks
This should typically return the Transform of a child GameObject or the transform itself.
See Also
OnDestroy()
See MonoBehaviour.
Declaration
protected override void OnDestroy()
Overrides
See Also
OnDrawGizmosSelected()
See MonoBehaviour.
Declaration
protected void OnDrawGizmosSelected()
See Also
OnHoverEntered(HoverEnterEventArgs)
The XRInteractionManager calls this method when the Interactor first initiates hovering over an Interactable in a second pass.
Declaration
protected override void OnHoverEntered(HoverEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
HoverEnterEventArgs | args | Event data containing the Interactor that is initiating the hover. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnHoverExited(HoverExitEventArgs)
The XRInteractionManager calls this method when the Interactor ends hovering over an Interactable in a second pass.
Declaration
protected override void OnHoverExited(HoverExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
HoverExitEventArgs | args | Event data containing the Interactor that is ending the hover. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
ProcessInteractable(UpdatePhase)
The XRInteractionManager calls this method to update the Interactable.
Declaration
public override void ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase this is called during. |
Overrides
Remarks
Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.
See Also
Events
destinationAnchorChanged
Calls the methods in its invocation list when the destinationAnchor changes.
Declaration
public event Action<TeleportationMultiAnchorVolume> destinationAnchorChanged
Event Type
Type | Description |
---|---|
Action<TeleportationMultiAnchorVolume> |