Class BaseTeleportationInteractable
This is intended to be the base class for all Teleportation Interactables. This abstracts the teleport request process for specializations of this class.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public abstract class BaseTeleportationInteractable : XRBaseInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRInteractable
Properties
matchOrientation
How to orient the rig after teleportation.
Declaration
public MatchOrientation matchOrientation { get; set; }
Property Value
Type | Description |
---|---|
MatchOrientation |
Remarks
Set to:
- WorldSpaceUp to stay oriented according to the world space up vector.
- TargetUp to orient according to the target BaseTeleportationInteractable Transform's up vector.
- TargetUpAndForward to orient according to the target BaseTeleportationInteractable Transform's rotation.
- None to maintain the same orientation before and after teleporting.
teleportationProvider
The teleportation provider that this teleportation interactable communicates teleport requests to. If no teleportation provider is configured, will attempt to find a teleportation provider during Awake.
Declaration
public TeleportationProvider teleportationProvider { get; set; }
Property Value
Type | Description |
---|---|
TeleportationProvider |
teleporting
Gets or sets the event that Unity calls when queuing to teleport via the TeleportationProvider.
Declaration
public TeleportingEvent teleporting { get; set; }
Property Value
Type | Description |
---|---|
TeleportingEvent |
Remarks
The TeleportingEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
teleportTrigger
Specifies when the teleportation triggers.
Declaration
public BaseTeleportationInteractable.TeleportTrigger teleportTrigger { get; set; }
Property Value
Type | Description |
---|---|
BaseTeleportationInteractable.TeleportTrigger |
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
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 virtual 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 |
---|---|
Boolean | Returns true if the teleport request was successfully updated and should be queued. Otherwise, returns false. |
See Also
GenerateTeleportRequest(XRBaseInteractor, RaycastHit, ref TeleportRequest)
Automatically called upon the teleport trigger when a teleport request should be generated.
Declaration
[Obsolete("GenerateTeleportRequest(XRBaseInteractor, RaycastHit, ref TeleportRequest) has been deprecated. Use GenerateTeleportRequest(IXRInteractor, RaycastHit, ref TeleportRequest) instead.")]
protected virtual bool GenerateTeleportRequest(XRBaseInteractor interactor, RaycastHit raycastHit, ref TeleportRequest teleportRequest)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | 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 |
---|---|
Boolean | Returns true if the teleport request was successfully updated and should be queued. Otherwise, returns false. |
Remarks
GenerateTeleportRequest(XRBaseInteractor, RaycastHit, ref TeleportRequest)
has been deprecated. Use GenerateTeleportRequest(IXRInteractor, RaycastHit, ref TeleportRequest) instead.
See Also
OnActivated(ActivateEventArgs)
XRBaseControllerInteractor calls this method when the Interactor begins an activation event on this Interactable.
Declaration
protected override void OnActivated(ActivateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
ActivateEventArgs | args | Event data containing the Interactor that is sending the activate event. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnDeactivated(DeactivateEventArgs)
XRBaseControllerInteractor calls this method when the Interactor ends an activation event on this Interactable.
Declaration
protected override void OnDeactivated(DeactivateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DeactivateEventArgs | args | Event data containing the Interactor that is sending the deactivate event. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnSelectEntered(SelectEnterEventArgs)
The XRInteractionManager calls this method when the Interactor first initiates selection of an Interactable in a second pass.
Declaration
protected override void OnSelectEntered(SelectEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectEnterEventArgs | args | Event data containing the Interactor that is initiating the selection. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnSelectExited(SelectExitEventArgs)
The XRInteractionManager calls this method when the Interactor ends selection of an Interactable in a second pass.
Declaration
protected override void OnSelectExited(SelectExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectExitEventArgs | args | Event data containing the Interactor that is ending the selection. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
Reset()
See MonoBehaviour.
Declaration
protected override void Reset()