Class XRInteractionManager
The Interaction Manager acts as an intermediary between Interactors and Interactables. It is possible to have multiple Interaction Managers, each with their own valid set of Interactors and Interactables. Upon being enabled, both Interactors and Interactables register themselves with a valid Interaction Manager (if a specific one has not already been assigned in the inspector). The loaded scenes must have at least one Interaction Manager for Interactors and Interactables to be able to communicate.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("XR/XR Interaction Manager", 11)]
[DisallowMultipleComponent]
[DefaultExecutionOrder(-100)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.html")]
public class XRInteractionManager : MonoBehaviour
Remarks
Many of the methods on the Interactors and Interactables are designed to be called by this Interaction Manager rather than being called directly in order to maintain consistency between both targets of an interaction event.
Methods
CancelInteractableHover(IXRHoverInteractable)
Automatically called when an Interactable is unregistered to cancel the hover state of the Interactable if necessary.
Declaration
public virtual void CancelInteractableHover(IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractable | interactable | The Interactable to potentially exit its hover state due to cancellation. |
CancelInteractableHover(XRBaseInteractable)
Automatically called when an Interactable is unregistered to cancel the hover state of the Interactable if necessary.
Declaration
[Obsolete("CancelInteractableHover(XRBaseInteractable) has been deprecated. Use CancelInteractableHover(IXRHoverInteractable) instead.")]
public virtual void CancelInteractableHover(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable | The Interactable to potentially exit its hover state due to cancellation. |
Remarks
CancelInteractableHover(XRBaseInteractable)
has been deprecated. Use CancelInteractableHover(IXRHoverInteractable) instead.
CancelInteractableSelection(IXRSelectInteractable)
Automatically called when an Interactable is unregistered to cancel the selection of the Interactable if necessary.
Declaration
public virtual void CancelInteractableSelection(IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractable | interactable | The Interactable to potentially exit its selection state due to cancellation. |
CancelInteractableSelection(XRBaseInteractable)
Automatically called when an Interactable is unregistered to cancel the selection of the Interactable if necessary.
Declaration
[Obsolete("CancelInteractableSelection(XRBaseInteractable) has been deprecated. Use CancelInteractableSelection(IXRSelectInteractable) instead.")]
public virtual void CancelInteractableSelection(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable | The Interactable to potentially exit its selection state due to cancellation. |
Remarks
CancelInteractableSelection(XRBaseInteractable)
has been deprecated. Use CancelInteractableSelection(IXRSelectInteractable) instead.
CancelInteractorHover(IXRHoverInteractor)
Automatically called when an Interactor is unregistered to cancel the hover state of the Interactor if necessary.
Declaration
public virtual void CancelInteractorHover(IXRHoverInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to potentially exit its hover state due to cancellation. |
CancelInteractorHover(XRBaseInteractor)
Automatically called when an Interactor is unregistered to cancel the hover state of the Interactor if necessary.
Declaration
[Obsolete("CancelInteractorHover(XRBaseInteractor) has been deprecated. Use CancelInteractorHover(IXRHoverInteractor) instead.")]
public virtual void CancelInteractorHover(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor to potentially exit its hover state due to cancellation. |
Remarks
CancelInteractorHover(XRBaseInteractor)
has been deprecated. Use CancelInteractorHover(IXRHoverInteractor) instead.
CancelInteractorSelection(IXRSelectInteractor)
Automatically called when an Interactor is unregistered to cancel the selection of the Interactor if necessary.
Declaration
public virtual void CancelInteractorSelection(IXRSelectInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor to potentially exit its selection state due to cancellation. |
CancelInteractorSelection(XRBaseInteractor)
Automatically called when an Interactor is unregistered to cancel the selection of the Interactor if necessary.
Declaration
[Obsolete("CancelInteractorSelection(XRBaseInteractor) has been deprecated. Use CancelInteractorSelection(IXRSelectInteractor) instead.")]
public virtual void CancelInteractorSelection(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor to potentially exit its selection state due to cancellation. |
Remarks
CancelInteractorSelection(XRBaseInteractor)
has been deprecated. Use CancelInteractorSelection(IXRSelectInteractor) instead.
ClearInteractorHover(IXRHoverInteractor, List<IXRInteractable>)
Automatically called each frame during Update to clear the hover state of the Interactor if necessary due to current conditions.
Declaration
protected virtual void ClearInteractorHover(IXRHoverInteractor interactor, List<IXRInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to potentially exit its hover state. |
List<IXRInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
See Also
ClearInteractorHover(XRBaseInteractor, List<XRBaseInteractable>)
Automatically called each frame during Update to clear the hover state of the Interactor if necessary due to current conditions.
Declaration
[Obsolete("ClearInteractorHover(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use ClearInteractorHover(IXRHoverInteractor, List<IXRInteractable>) instead.")]
public virtual void ClearInteractorHover(XRBaseInteractor interactor, List<XRBaseInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor to potentially exit its hover state. |
List<XRBaseInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
Remarks
ClearInteractorHover(XRBaseInteractor, List<XRBaseInteractable>)
has been deprecated. Use ClearInteractorHover(IXRHoverInteractor, List<IXRInteractable>) instead.
ClearInteractorSelection(IXRSelectInteractor, List<IXRInteractable>)
Automatically called each frame during Update to clear the selection of the Interactor if necessary due to current conditions.
Declaration
protected virtual void ClearInteractorSelection(IXRSelectInteractor interactor, List<IXRInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor to potentially exit its selection state. |
List<IXRInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
See Also
ClearInteractorSelection(XRBaseInteractor)
Automatically called each frame during Update to clear the selection of the Interactor if necessary due to current conditions.
Declaration
[Obsolete("ClearInteractorSelection(XRBaseInteractor) has been deprecated. Use ClearInteractorSelection(IXRSelectInteractor, List<IXRInteractable>) instead.")]
public virtual void ClearInteractorSelection(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor to potentially exit its selection state. |
Remarks
ClearInteractorSelection(XRBaseInteractor)
has been deprecated. Use ClearInteractorSelection(IXRSelectInteractor, List<IXRInteractable>) instead.
FixedUpdate()
See MonoBehaviour.
Declaration
protected virtual void FixedUpdate()
ForceSelect(XRBaseInteractor, XRBaseInteractable)
Manually forces selection of an Interactable. This is different than starting manual interaction.
Declaration
[Obsolete("ForceSelect(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable) instead.")]
public void ForceSelect(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that will select the Interactable. |
XRBaseInteractable | interactable | The Interactable to be selected. |
Remarks
ForceSelect(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable) instead.
GetColliderToInteractableMap(ref Dictionary<Collider, XRBaseInteractable>)
Gets the dictionary that has all the registered colliders and their associated Interactable.
Declaration
[Obsolete("GetColliderToInteractableMap has been deprecated. The signature no longer matches the field used by the XRInteractionManager, so a copy is returned instead of a ref. Changes to the returned Dictionary will not be observed by the XRInteractionManager.", true)]
public void GetColliderToInteractableMap(ref Dictionary<Collider, XRBaseInteractable> map)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<Collider, XRBaseInteractable> | map | When this method returns, contains the dictionary that has all the registered colliders and their associated Interactable. |
Remarks
Clears map
before adding to it.
GetColliderToInteractableMap
has been deprecated. GetColliderToInteractableMap has been deprecated. The signature no longer matches the field used by the XRInteractionManager, so a copy is returned instead of a ref. Changes to the returned Dictionary will not be observed by the XRInteractionManager.
GetInteractableForCollider(Collider)
Gets the Interactable a specific collider is attached to.
Declaration
[Obsolete("GetInteractableForCollider has been deprecated. Use TryGetInteractableForCollider(Collider, out IXRInteractable) instead.")]
public XRBaseInteractable GetInteractableForCollider(Collider interactableCollider)
Parameters
Type | Name | Description |
---|---|---|
Collider | interactableCollider | The collider of the Interactable to retrieve. |
Returns
Type | Description |
---|---|
XRBaseInteractable | Returns the Interactable that the collider is attached to. Otherwise returns null if no such Interactable exists. |
Remarks
GetInteractableForCollider
has been deprecated. Use TryGetInteractableForCollider(Collider, out IXRInteractable) instead.
GetRegisteredInteractables(List<IXRInteractable>)
Returns all registered Interactables into List results
.
Declaration
public void GetRegisteredInteractables(List<IXRInteractable> results)
Parameters
Type | Name | Description |
---|---|---|
List<IXRInteractable> | results | List to receive registered Interactables. |
Remarks
This method populates the list with the registered Interactables at the time the
method is called. It is not a live view, meaning Interactables
registered or unregistered afterward will not be reflected in the
results of this method.
Clears results
before adding to it.
See Also
GetRegisteredInteractables(List<XRBaseInteractable>)
Returns all registered Interactables into List results
.
Declaration
[Obsolete("GetRegisteredInteractables(List<XRBaseInteractable>) has been deprecated. Use GetRegisteredInteractables(List<IXRInteractable>) instead.")]
public void GetRegisteredInteractables(List<XRBaseInteractable> results)
Parameters
Type | Name | Description |
---|---|---|
List<XRBaseInteractable> | results |
Remarks
GetRegisteredInteractables(List<XRBaseInteractable>)
has been deprecated. Use GetRegisteredInteractables(List<IXRInteractable>) instead.
See Also
GetRegisteredInteractors(List<IXRInteractor>)
Returns all registered Interactors into List results
.
Declaration
public void GetRegisteredInteractors(List<IXRInteractor> results)
Parameters
Type | Name | Description |
---|---|---|
List<IXRInteractor> | results | List to receive registered Interactors. |
Remarks
This method populates the list with the registered Interactors at the time the
method is called. It is not a live view, meaning Interactors
registered or unregistered afterward will not be reflected in the
results of this method.
Clears results
before adding to it.
See Also
GetRegisteredInteractors(List<XRBaseInteractor>)
Returns all registered Interactors into List results
.
Declaration
[Obsolete("GetRegisteredInteractors(List<XRBaseInteractor>) has been deprecated. Use GetRegisteredInteractors(List<IXRInteractor>) instead.")]
public void GetRegisteredInteractors(List<XRBaseInteractor> results)
Parameters
Type | Name | Description |
---|---|---|
List<XRBaseInteractor> | results |
Remarks
GetRegisteredInteractors(List<XRBaseInteractor>)
has been deprecated. Use GetRegisteredInteractors(List<IXRInteractor>) instead.
See Also
GetValidTargets(IXRInteractor, List<IXRInteractable>)
Retrieves the list of Interactables that the given Interactor could possibly interact with this frame. This list is sorted by priority (with highest priority first), and will only contain Interactables that are registered with this Interaction Manager.
Declaration
public void GetValidTargets(IXRInteractor interactor, List<IXRInteractable> targets)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to get valid targets for. |
List<IXRInteractable> | targets | The results list to populate with Interactables that are valid for selection or hover. |
Remarks
Unity expects the interactor
's implementation of GetValidTargets(List<IXRInteractable>) to clear targets
before adding to it.
See Also
GetValidTargets(XRBaseInteractor, List<XRBaseInteractable>)
For the provided interactor
, returns a list of the valid Interactables that can be hovered over or selected.
Declaration
[Obsolete("GetValidTargets(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use GetValidTargets(IXRInteractor, List<IXRInteractable>) instead.")]
public List<XRBaseInteractable> GetValidTargets(XRBaseInteractor interactor, List<XRBaseInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor whose valid targets we want to find. |
List<XRBaseInteractable> | validTargets | List to be filled with valid targets of the Interactor. |
Returns
Type | Description |
---|---|
List<XRBaseInteractable> | The list of valid targets of the Interactor. |
Remarks
GetValidTargets(XRBaseInteractor, List<XRBaseInteractable>)
has been deprecated. Use GetValidTargets(IXRInteractor, List<IXRInteractable>) instead.
See Also
HasInteractionLayerOverlap(IXRInteractor, IXRInteractable)
Determines whether the Interactor and Interactable share at least one interaction layer between their Interaction Layer Masks.
Declaration
protected static bool HasInteractionLayerOverlap(IXRInteractor interactor, IXRInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to check. |
IXRInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the Interactor and Interactable share at least one interaction layer. Otherwise, returns false. |
See Also
HoverCancel(IXRHoverInteractor, IXRHoverInteractable)
Initiates ending hovering of an Interactable by an Interactor due to cancellation, such as from either being unregistered due to being disabled or destroyed.
Declaration
public virtual void HoverCancel(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor that is no longer hovering. |
IXRHoverInteractable | interactable | The Interactable that is no longer being hovered over. |
HoverCancel(XRBaseInteractor, XRBaseInteractable)
Initiates ending hovering of an Interactable by an Interactor due to cancellation, such as from either being unregistered due to being disabled or destroyed.
Declaration
[Obsolete("HoverCancel(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use HoverCancel(IXRHoverInteractor, IXRHoverInteractable) instead.")]
public virtual void HoverCancel(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is no longer hovering. |
XRBaseInteractable | interactable | The Interactable that is no longer being hovered over. |
Remarks
HoverCancel(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use HoverCancel(IXRHoverInteractor, IXRHoverInteractable) instead.
HoverEnter(IXRHoverInteractor, IXRHoverInteractable)
Initiates hovering of an Interactable by an Interactor.
Declaration
public virtual void HoverEnter(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor that is hovering. |
IXRHoverInteractable | interactable | The Interactable being hovered over. |
HoverEnter(IXRHoverInteractor, IXRHoverInteractable, HoverEnterEventArgs)
Initiates hovering of an Interactable by an Interactor, passing the given args
.
Declaration
protected virtual void HoverEnter(IXRHoverInteractor interactor, IXRHoverInteractable interactable, HoverEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor that is hovering. |
IXRHoverInteractable | interactable | The Interactable being hovered over. |
HoverEnterEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
The interactor and interactable are notified immediately without waiting for a previous call to finish in the case when this method is called again in a nested way. This means that if this method is called during the handling of the first event, the second will start and finish before the first event finishes calling all methods in the sequence to notify of the first event.
HoverEnter(XRBaseInteractor, XRBaseInteractable)
Initiates hovering of an Interactable by an Interactor.
Declaration
[Obsolete("HoverEnter(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use HoverEnter(IXRHoverInteractor, IXRHoverInteractable) instead.")]
public virtual void HoverEnter(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is hovering. |
XRBaseInteractable | interactable | The Interactable being hovered over. |
Remarks
HoverEnter(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use HoverEnter(IXRHoverInteractor, IXRHoverInteractable) instead.
HoverEnter(XRBaseInteractor, XRBaseInteractable, HoverEnterEventArgs)
Initiates hovering of an Interactable by an Interactor, passing the given args
.
Declaration
[Obsolete("HoverEnter(XRBaseInteractor, XRBaseInteractable, HoverEnterEventArgs) has been deprecated. Use HoverEnter(IXRHoverInteractor, IXRHoverInteractable, HoverEnterEventArgs) instead.")]
protected virtual void HoverEnter(XRBaseInteractor interactor, XRBaseInteractable interactable, HoverEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is hovering. |
XRBaseInteractable | interactable | The Interactable being hovered over. |
HoverEnterEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
HoverEnter(XRBaseInteractor, XRBaseInteractable, HoverEnterEventArgs)
has been deprecated. Use HoverEnter(IXRHoverInteractor, IXRHoverInteractable, HoverEnterEventArgs) instead.
HoverExit(IXRHoverInteractor, IXRHoverInteractable)
Initiates ending hovering of an Interactable by an Interactor.
Declaration
public virtual void HoverExit(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor that is no longer hovering. |
IXRHoverInteractable | interactable | The Interactable that is no longer being hovered over. |
HoverExit(IXRHoverInteractor, IXRHoverInteractable, HoverExitEventArgs)
Initiates ending hovering of an Interactable by an Interactor, passing the given args
.
Declaration
protected virtual void HoverExit(IXRHoverInteractor interactor, IXRHoverInteractable interactable, HoverExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor that is no longer hovering. |
IXRHoverInteractable | interactable | The Interactable that is no longer being hovered over. |
HoverExitEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
The interactor and interactable are notified immediately without waiting for a previous call to finish in the case when this method is called again in a nested way. This means that if this method is called during the handling of the first event, the second will start and finish before the first event finishes calling all methods in the sequence to notify of the first event.
HoverExit(XRBaseInteractor, XRBaseInteractable)
Initiates ending hovering of an Interactable by an Interactor.
Declaration
[Obsolete("HoverExit(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use HoverExit(IXRHoverInteractor, IXRHoverInteractable) instead.")]
public virtual void HoverExit(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is no longer hovering. |
XRBaseInteractable | interactable | The Interactable that is no longer being hovered over. |
Remarks
HoverExit(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use HoverExit(IXRHoverInteractor, IXRHoverInteractable) instead.
HoverExit(XRBaseInteractor, XRBaseInteractable, HoverExitEventArgs)
Initiates ending hovering of an Interactable by an Interactor, passing the given args
.
Declaration
[Obsolete("HoverExit(XRBaseInteractor, XRBaseInteractable, HoverExitEventArgs) has been deprecated. Use HoverExit(IXRHoverInteractor, IXRHoverInteractable, HoverExitEventArgs) instead.")]
protected virtual void HoverExit(XRBaseInteractor interactor, XRBaseInteractable interactable, HoverExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is no longer hovering. |
XRBaseInteractable | interactable | The Interactable that is no longer being hovered over. |
HoverExitEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
HoverExit(XRBaseInteractor, XRBaseInteractable, HoverExitEventArgs)
has been deprecated. Use HoverExit(IXRHoverInteractor, IXRHoverInteractable, HoverExitEventArgs) instead.
InteractorHoverValidTargets(IXRHoverInteractor, List<IXRInteractable>)
Automatically called each frame during Update to enter the hover state of the Interactor if necessary due to current conditions.
Declaration
protected virtual void InteractorHoverValidTargets(IXRHoverInteractor interactor, List<IXRInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to potentially enter its hover state. |
List<IXRInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
See Also
InteractorHoverValidTargets(XRBaseInteractor, List<XRBaseInteractable>)
Automatically called each frame during Update to enter the hover state of the Interactor if necessary due to current conditions.
Declaration
[Obsolete("InteractorHoverValidTargets(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use InteractorHoverValidTargets(IXRHoverInteractor, List<IXRInteractable>) instead.")]
protected virtual void InteractorHoverValidTargets(XRBaseInteractor interactor, List<XRBaseInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor to potentially enter its hover state. |
List<XRBaseInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
Remarks
InteractorHoverValidTargets(XRBaseInteractor, List<XRBaseInteractable>)
has been deprecated. Use InteractorHoverValidTargets(IXRHoverInteractor, List<IXRInteractable>) instead.
InteractorSelectValidTargets(IXRSelectInteractor, List<IXRInteractable>)
Automatically called each frame during Update to enter the selection state of the Interactor if necessary due to current conditions.
Declaration
protected virtual void InteractorSelectValidTargets(IXRSelectInteractor interactor, List<IXRInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor to potentially enter its selection state. |
List<IXRInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
See Also
InteractorSelectValidTargets(XRBaseInteractor, List<XRBaseInteractable>)
Automatically called each frame during Update to enter the selection state of the Interactor if necessary due to current conditions.
Declaration
[Obsolete("InteractorSelectValidTargets(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use InteractorSelectValidTargets(IXRSelectInteractor, List<IXRInteractable>) instead.")]
protected virtual void InteractorSelectValidTargets(XRBaseInteractor interactor, List<XRBaseInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor to potentially enter its selection state. |
List<XRBaseInteractable> | validTargets | The list of interactables that this Interactor could possibly interact with this frame. |
Remarks
InteractorSelectValidTargets(XRBaseInteractor, List<XRBaseInteractable>)
has been deprecated. Use InteractorSelectValidTargets(IXRSelectInteractor, List<IXRInteractable>) instead.
IsRegistered(IXRInteractable)
Checks whether the interactable
is registered with this Interaction Manager.
Declaration
public bool IsRegistered(IXRInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
Boolean |
See Also
IsRegistered(IXRInteractor)
Checks whether the interactor
is registered with this Interaction Manager.
Declaration
public bool IsRegistered(IXRInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to check. |
Returns
Type | Description |
---|---|
Boolean |
See Also
IsRegistered(XRBaseInteractable)
Checks whether the interactable
is registered with this Interaction Manager.
Declaration
[Obsolete("IsRegistered(XRBaseInteractable) has been deprecated. Use IsRegistered(IXRInteractable) instead.")]
public bool IsRegistered(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable |
Returns
Type | Description |
---|---|
Boolean |
Remarks
IsRegistered(XRBaseInteractable)
has been deprecated. Use IsRegistered(IXRInteractable) instead.
See Also
IsRegistered(XRBaseInteractor)
Checks whether the interactor
is registered with this Interaction Manager.
Declaration
[Obsolete("IsRegistered(XRBaseInteractor) has been deprecated. Use IsRegistered(IXRInteractor) instead.")]
public bool IsRegistered(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor |
Returns
Type | Description |
---|---|
Boolean |
Remarks
IsRegistered(XRBaseInteractor)
has been deprecated. Use IsRegistered(IXRInteractor) instead.
See Also
LateUpdate()
See MonoBehaviour.
Declaration
protected virtual void LateUpdate()
OnBeforeRender()
Delegate method used to register for "Just Before Render" input updates for VR devices.
Declaration
[BeforeRenderOrder(100)]
protected virtual void OnBeforeRender()
See Also
OnDisable()
See MonoBehaviour.
Declaration
protected virtual void OnDisable()
OnEnable()
See MonoBehaviour.
Declaration
protected virtual void OnEnable()
OnRegistered(InteractableRegisteredEventArgs)
Automatically called when an Interactable is registered with this Interaction Manager.
Notifies the Interactable, passing the given args
.
Declaration
protected virtual void OnRegistered(InteractableRegisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractableRegisteredEventArgs | args | Event data containing the registered Interactable. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnRegistered(InteractorRegisteredEventArgs)
Automatically called when an Interactor is registered with this Interaction Manager.
Notifies the Interactor, passing the given args
.
Declaration
protected virtual void OnRegistered(InteractorRegisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractorRegisteredEventArgs | args | Event data containing the registered Interactor. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnUnregistered(InteractableUnregisteredEventArgs)
Automatically called when an Interactable is unregistered from this Interaction Manager.
Notifies the Interactable, passing the given args
.
Declaration
protected virtual void OnUnregistered(InteractableUnregisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractableUnregisteredEventArgs | args | Event data containing the unregistered Interactable. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnUnregistered(InteractorUnregisteredEventArgs)
Automatically called when an Interactor is unregistered from this Interaction Manager.
Notifies the Interactor, passing the given args
.
Declaration
protected virtual void OnUnregistered(InteractorUnregisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractorUnregisteredEventArgs | args | Event data containing the unregistered Interactor. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
PreprocessInteractors(XRInteractionUpdateOrder.UpdatePhase)
Automatically called each frame to preprocess all interactors registered with this manager.
Declaration
protected virtual void PreprocessInteractors(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase. |
Remarks
Please see the XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.
See Also
ProcessInteractables(XRInteractionUpdateOrder.UpdatePhase)
Automatically called each frame to process all interactables registered with this manager.
Declaration
protected virtual void ProcessInteractables(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase. |
Remarks
Please see the XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.
See Also
ProcessInteractors(XRInteractionUpdateOrder.UpdatePhase)
Automatically called each frame to process all interactors registered with this manager.
Declaration
protected virtual void ProcessInteractors(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase. |
Remarks
Please see the XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.
See Also
RegisterInteractable(IXRInteractable)
Registers a new Interactable to be processed.
Declaration
public virtual void RegisterInteractable(IXRInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractable | interactable | The Interactable to be registered. |
RegisterInteractable(XRBaseInteractable)
Registers a new Interactable to be processed.
Declaration
[Obsolete("RegisterInteractable(XRBaseInteractable) has been deprecated. Use RegisterInteractable(IXRInteractable) instead.")]
public virtual void RegisterInteractable(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable |
Remarks
RegisterInteractable(XRBaseInteractable)
has been deprecated. Use RegisterInteractable(IXRInteractable) instead.
RegisterInteractor(IXRInteractor)
Registers a new Interactor to be processed.
Declaration
public virtual void RegisterInteractor(IXRInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to be registered. |
RegisterInteractor(XRBaseInteractor)
Registers a new Interactor to be processed.
Declaration
[Obsolete("RegisterInteractor(XRBaseInteractor) has been deprecated. Use RegisterInteractor(IXRInteractor) instead.")]
public virtual void RegisterInteractor(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor |
Remarks
RegisterInteractor(XRBaseInteractor)
has been deprecated. Use RegisterInteractor(IXRInteractor) instead.
ResolveExistingSelect(IXRSelectInteractor, IXRSelectInteractable)
Automatically called when selection of an Interactable by an Interactor is initiated and the Interactable is already selected.
Declaration
protected virtual bool ResolveExistingSelect(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor that is selecting. |
IXRSelectInteractable | interactable | The Interactable being selected. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the existing selection was successfully resolved and selection should continue. Otherwise, returns false if the select should be ignored. |
See Also
SelectCancel(IXRSelectInteractor, IXRSelectInteractable)
Initiates ending selection of an Interactable by an Interactor due to cancellation, such as from either being unregistered due to being disabled or destroyed.
Declaration
public virtual void SelectCancel(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor that is no longer selecting. |
IXRSelectInteractable | interactable | The Interactable that is no longer being selected. |
SelectCancel(XRBaseInteractor, XRBaseInteractable)
Initiates ending selection of an Interactable by an Interactor due to cancellation, such as from either being unregistered due to being disabled or destroyed.
Declaration
[Obsolete("SelectCancel(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectCancel(IXRSelectInteractor, IXRSelectInteractable) instead.")]
public virtual void SelectCancel(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is no longer selecting. |
XRBaseInteractable | interactable | The Interactable that is no longer being selected. |
Remarks
SelectCancel(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use SelectCancel(IXRSelectInteractor, IXRSelectInteractable) instead.
SelectEnter(IXRSelectInteractor, IXRSelectInteractable)
Initiates selection of an Interactable by an Interactor. This method may first result in other interaction events such as causing the Interactable to first exit being selected.
Declaration
public virtual void SelectEnter(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor that is selecting. |
IXRSelectInteractable | interactable | The Interactable being selected. |
Remarks
This attempt may be ignored depending on the selection policy of the Interactor and/or the Interactable.
SelectEnter(IXRSelectInteractor, IXRSelectInteractable, SelectEnterEventArgs)
Initiates selection of an Interactable by an Interactor, passing the given args
.
Declaration
protected virtual void SelectEnter(IXRSelectInteractor interactor, IXRSelectInteractable interactable, SelectEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor that is selecting. |
IXRSelectInteractable | interactable | The Interactable being selected. |
SelectEnterEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
The interactor and interactable are notified immediately without waiting for a previous call to finish in the case when this method is called again in a nested way. This means that if this method is called during the handling of the first event, the second will start and finish before the first event finishes calling all methods in the sequence to notify of the first event.
SelectEnter(XRBaseInteractor, XRBaseInteractable)
Initiates selection of an Interactable by an Interactor. This method may first result in other interaction events such as causing the Interactable to first exit being selected.
Declaration
[Obsolete("SelectEnter(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable) instead.")]
public virtual void SelectEnter(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is selecting. |
XRBaseInteractable | interactable | The Interactable being selected. |
Remarks
This attempt may be ignored depending on the selection policy of the Interactor and/or the Interactable.
SelectEnter(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable) instead.
SelectEnter(XRBaseInteractor, XRBaseInteractable, SelectEnterEventArgs)
Initiates selection of an Interactable by an Interactor, passing the given args
.
Declaration
[Obsolete("SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs) has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable, SelectExitEventArgs) instead.")]
protected virtual void SelectEnter(XRBaseInteractor interactor, XRBaseInteractable interactable, SelectEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is selecting. |
XRBaseInteractable | interactable | The Interactable being selected. |
SelectEnterEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs)
has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable, SelectExitEventArgs) instead.
SelectExit(IXRSelectInteractor, IXRSelectInteractable)
Initiates ending selection of an Interactable by an Interactor.
Declaration
public virtual void SelectExit(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor that is no longer selecting. |
IXRSelectInteractable | interactable | The Interactable that is no longer being selected. |
SelectExit(IXRSelectInteractor, IXRSelectInteractable, SelectExitEventArgs)
Initiates ending selection of an Interactable by an Interactor, passing the given args
.
Declaration
protected virtual void SelectExit(IXRSelectInteractor interactor, IXRSelectInteractable interactable, SelectExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor that is no longer selecting. |
IXRSelectInteractable | interactable | The Interactable that is no longer being selected. |
SelectExitEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
The interactor and interactable are notified immediately without waiting for a previous call to finish in the case when this method is called again in a nested way. This means that if this method is called during the handling of the first event, the second will start and finish before the first event finishes calling all methods in the sequence to notify of the first event.
SelectExit(XRBaseInteractor, XRBaseInteractable)
Initiates ending selection of an Interactable by an Interactor.
Declaration
[Obsolete("SelectExit(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable) instead.")]
public virtual void SelectExit(XRBaseInteractor interactor, XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is no longer selecting. |
XRBaseInteractable | interactable | The Interactable that is no longer being selected. |
Remarks
SelectExit(XRBaseInteractor, XRBaseInteractable)
has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable) instead.
SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs)
Initiates ending selection of an Interactable by an Interactor, passing the given args
.
Declaration
[Obsolete("SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs) has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable, SelectExitEventArgs) instead.")]
protected virtual void SelectExit(XRBaseInteractor interactor, XRBaseInteractable interactable, SelectExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor | The Interactor that is no longer selecting. |
XRBaseInteractable | interactable | The Interactable that is no longer being selected. |
SelectExitEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs)
has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable, SelectExitEventArgs) instead.
TryGetInteractableForCollider(Collider)
Gets the Interactable a specific collider is attached to.
Declaration
[Obsolete("TryGetInteractableForCollider has been deprecated. Use GetInteractableForCollider instead. (UnityUpgradable) -> GetInteractableForCollider(*)")]
public XRBaseInteractable TryGetInteractableForCollider(Collider interactableCollider)
Parameters
Type | Name | Description |
---|---|---|
Collider | interactableCollider | The collider of the Interactable to retrieve. |
Returns
Type | Description |
---|---|
XRBaseInteractable | Returns the Interactable that the collider is attached to. Otherwise returns null if no such Interactable exists. |
Remarks
TryGetInteractableForCollider
has been deprecated. Use GetInteractableForCollider(Collider) instead.
TryGetInteractableForCollider(Collider, out IXRInteractable)
Gets the Interactable a specific Collider is attached to.
Declaration
public bool TryGetInteractableForCollider(Collider interactableCollider, out IXRInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
Collider | interactableCollider | The collider of the Interactable to retrieve. |
IXRInteractable | interactable | The returned Interactable associated with the collider. |
Returns
Type | Description |
---|---|
Boolean | Returns true if an Interactable was associated with the collider. Otherwise, returns false. |
UnregisterInteractable(IXRInteractable)
Unregister an Interactable so it is no longer processed.
Declaration
public virtual void UnregisterInteractable(IXRInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractable | interactable | The Interactable to be unregistered. |
UnregisterInteractable(XRBaseInteractable)
Unregister an Interactable so it is no longer processed.
Declaration
[Obsolete("UnregisterInteractable(XRBaseInteractable) has been deprecated. Use UnregisterInteractable(IXRInteractable) instead.")]
public virtual void UnregisterInteractable(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable |
Remarks
UnregisterInteractable(XRBaseInteractable)
has been deprecated. Use UnregisterInteractable(IXRInteractable) instead.
UnregisterInteractor(IXRInteractor)
Unregister an Interactor so it is no longer processed.
Declaration
public virtual void UnregisterInteractor(IXRInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to be unregistered. |
UnregisterInteractor(XRBaseInteractor)
Unregister an Interactor so it is no longer processed.
Declaration
[Obsolete("UnregisterInteractor(XRBaseInteractor) has been deprecated. Use UnregisterInteractor(IXRInteractor) instead.")]
public virtual void UnregisterInteractor(XRBaseInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractor | interactor |
Remarks
UnregisterInteractor(XRBaseInteractor)
has been deprecated. Use UnregisterInteractor(IXRInteractor) instead.
Update()
See MonoBehaviour.
Declaration
protected virtual void Update()
Events
interactableRegistered
Calls the methods in its invocation list when an IXRInteractable is registered.
Declaration
public event Action<InteractableRegisteredEventArgs> interactableRegistered
Event Type
Type | Description |
---|---|
Action<InteractableRegisteredEventArgs> |
Remarks
The InteractableRegisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
interactableUnregistered
Calls the methods in its invocation list when an IXRInteractable is unregistered.
Declaration
public event Action<InteractableUnregisteredEventArgs> interactableUnregistered
Event Type
Type | Description |
---|---|
Action<InteractableUnregisteredEventArgs> |
Remarks
The InteractableUnregisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
interactorRegistered
Calls the methods in its invocation list when an IXRInteractor is registered.
Declaration
public event Action<InteractorRegisteredEventArgs> interactorRegistered
Event Type
Type | Description |
---|---|
Action<InteractorRegisteredEventArgs> |
Remarks
The InteractorRegisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
interactorUnregistered
Calls the methods in its invocation list when an IXRInteractor is unregistered.
Declaration
public event Action<InteractorUnregisteredEventArgs> interactorUnregistered
Event Type
Type | Description |
---|---|
Action<InteractorUnregisteredEventArgs> |
Remarks
The InteractorUnregisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.