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
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/XR Interaction Manager", 11)]
[DisallowMultipleComponent]
[DefaultExecutionOrder(-105)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.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.
Properties
hoverFilters
The list of global hover filters in this object. Used as additional hover validations for this manager.
Declaration
public IXRFilterList<IXRHoverFilter> hoverFilters { get; }
Property Value
Type | Description |
---|---|
IXRFilterList<IXRHoverFilter> |
Remarks
While processing hover filters, all changes to this list don't have an immediate effect. These changes are buffered and applied when the processing is finished. Calling MoveTo(T, int) in this list will throw an exception when this list is being processed.
See Also
lastFocused
(Read Only) The last IXRFocusInteractable that was focused by any IXRInteractor.
Declaration
public IXRFocusInteractable lastFocused { get; protected set; }
Property Value
Type | Description |
---|---|
IXRFocusInteractable |
See Also
selectFilters
The list of global select filters in this object. Used as additional select validations for this manager.
Declaration
public IXRFilterList<IXRSelectFilter> selectFilters { get; }
Property Value
Type | Description |
---|---|
IXRFilterList<IXRSelectFilter> |
Remarks
While processing select filters, all changes to this list don't have an immediate effect. These changes are buffered and applied when the processing is finished. Calling MoveTo(T, int) in this list will throw an exception when this list is being processed.
See Also
startingHoverFilters
The hover filters that this object uses to automatically populate the hoverFilters List at startup (optional, may be empty). All objects in this list should implement the IXRHoverFilter interface.
Declaration
public List<Object> startingHoverFilters { get; set; }
Property Value
Type | Description |
---|---|
List<Object> |
Remarks
To access and modify the hover filters used after startup, the hoverFilters List should be used instead.
See Also
startingSelectFilters
The select filters that this object uses to automatically populate the selectFilters List at startup (optional, may be empty). All objects in this list should implement the IXRSelectFilter interface.
Declaration
public List<Object> startingSelectFilters { get; set; }
Property Value
Type | Description |
---|---|
List<Object> |
Remarks
To access and modify the select filters used after startup, the selectFilters List should be used instead.
See Also
Methods
Awake()
See MonoBehaviour.
Declaration
protected virtual void Awake()
See Also
CanFocus(IXRInteractor, IXRFocusInteractable)
Whether the given Interactor can gain focus of the given Interactable. You can extend this method to add global focus validations by code.
Declaration
public virtual bool CanFocus(IXRInteractor interactor, IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to check. |
IXRFocusInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns whether the given Interactor can gain focus of the given Interactable. |
See Also
CanHover(IXRHoverInteractor, IXRHoverInteractable)
Whether the given Interactor can hover the given Interactable. You can extend this method to add global hover validations by code.
Declaration
public virtual bool CanHover(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to check. |
IXRHoverInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns whether the given Interactor can hover the given Interactable. |
Remarks
You can also extend the global hover validations without needing to create a derived class by adding hover filters to this object (see startingHoverFilters and hoverFilters).
See Also
CanSelect(IXRSelectInteractor, IXRSelectInteractable)
Whether the given Interactor can select the given Interactable. You can extend this method to add global select validations by code.
Declaration
public virtual bool CanSelect(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor to check. |
IXRSelectInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns whether the given Interactor can select the given Interactable. |
Remarks
You can also extend the global select validations without needing to create a derived class by adding select filters to this object (see startingSelectFilters and selectFilters).
See Also
CancelInteractableFocus(IXRFocusInteractable)
Automatically called when an Interactable is unregistered to cancel the focus of the Interactable if necessary.
Declaration
public virtual void CancelInteractableFocus(IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRFocusInteractable | interactable | The Interactable to potentially exit its focus state due to cancellation. |
See Also
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. |
See Also
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. |
See Also
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. |
See Also
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. |
See Also
ClearInteractionGroupFocus(IXRInteractionGroup)
Automatically called each frame during Update to clear the focus of the interaction group if necessary due to current conditions.
Declaration
protected virtual void ClearInteractionGroupFocus(IXRInteractionGroup interactionGroup)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | interactionGroup | The interaction group to potentially exit its focus state. |
See Also
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
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
FixedUpdate()
See MonoBehaviour.
Declaration
protected virtual void FixedUpdate()
See Also
FocusCancel(IXRInteractionGroup, IXRFocusInteractable)
Initiates losing focus of an Interactable by an Interaction group due to cancellation, such as from either being unregistered due to being disabled or destroyed.
Declaration
public virtual void FocusCancel(IXRInteractionGroup group, IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | group | The Interaction group that is losing focus of the interactable. |
IXRFocusInteractable | interactable | The Interactable that is no longer focused. |
See Also
FocusEnter(IXRInteractionGroup, IXRFocusInteractable, FocusEnterEventArgs)
Initiates focus of an Interactable by an interaction group, passing the given args
.
Declaration
protected virtual void FocusEnter(IXRInteractionGroup group, IXRFocusInteractable interactable, FocusEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | group | The interaction group that is gaining focus. |
IXRFocusInteractable | interactable | The Interactable being focused. |
FocusEnterEventArgs | args | Event data containing the interaction group and Interactable involved in the event. |
Remarks
The interaction group 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.
See Also
FocusEnter(IXRInteractor, IXRFocusInteractable)
Initiates focus of an Interactable by an Interactor. This method may first result in other interaction events such as causing the Interactable to first lose focus.
Declaration
public virtual void FocusEnter(IXRInteractor interactor, IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor that is gaining focus. Must be a member of an Interaction group. |
IXRFocusInteractable | interactable | The Interactable being focused. |
Remarks
This attempt may be ignored depending on the focus policy of the Interactor and/or the Interactable. This attempt will also be ignored if the Interactor is not a member of an Interaction group.
See Also
FocusExit(IXRInteractionGroup, IXRFocusInteractable)
Initiates losing focus of an Interactable by an Interactor.
Declaration
public virtual void FocusExit(IXRInteractionGroup group, IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | group | The Interaction group that is losing focus. |
IXRFocusInteractable | interactable | The Interactable that is no longer focused. |
See Also
FocusExit(IXRInteractionGroup, IXRFocusInteractable, FocusExitEventArgs)
Initiates losing focus of an Interactable by an Interaction Group, passing the given args
.
Declaration
protected virtual void FocusExit(IXRInteractionGroup group, IXRFocusInteractable interactable, FocusExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | group | The Interaction Group that is no longer selecting. |
IXRFocusInteractable | interactable | The Interactable that is no longer being selected. |
FocusExitEventArgs | args | Event data containing the Interactor and Interactable involved in the event. |
Remarks
The interactable is 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.
See Also
GetInteractionGroup(string)
Gets the registered Interaction Group with the given name.
Declaration
public IXRInteractionGroup GetInteractionGroup(string groupName)
Parameters
Type | Name | Description |
---|---|---|
string | groupName | The name of the interaction group to retrieve. |
Returns
Type | Description |
---|---|
IXRInteractionGroup | Returns the interaction group with matching name, or null if none were found. |
See Also
GetInteractionGroups(List<IXRInteractionGroup>)
Gets all currently registered Interaction groups
Declaration
public void GetInteractionGroups(List<IXRInteractionGroup> interactionGroups)
Parameters
Type | Name | Description |
---|---|---|
List<IXRInteractionGroup> | interactionGroups | The list that will filled with all of the registered interaction groups |
See Also
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
GetRegisteredInteractionGroups(List<IXRInteractionGroup>)
Returns all registered Interaction Groups into List results
.
Declaration
public void GetRegisteredInteractionGroups(List<IXRInteractionGroup> results)
Parameters
Type | Name | Description |
---|---|---|
List<IXRInteractionGroup> | results | List to receive registered Interaction Groups. |
Remarks
This method populates the list with the registered Interaction Groups at the time the
method is called. It is not a live view, meaning Interaction Groups
registered or unregistered afterward will not be reflected in the
results of this method.
Clears results
before adding to it.
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
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, hover, or focus. |
Remarks
Unity expects the interactor
's implementation of GetValidTargets(List<IXRInteractable>) to clear targets
before adding to it.
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 |
---|---|
bool | 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. |
See Also
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. |
See Also
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.
See Also
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. |
See Also
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.
See Also
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
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. |
Remarks
If the Interactor implements IXRTargetPriorityInteractor and is configured to monitor Targets, this method will update its Targets For Selection property.
See Also
IsColliderRegisteredSnapVolume(in Collider)
Checks if the given potentialSnapVolumeCollider
is registered with a snap volume.
Declaration
public bool IsColliderRegisteredSnapVolume(in Collider potentialSnapVolumeCollider)
Parameters
Type | Name | Description |
---|---|---|
Collider | potentialSnapVolumeCollider | Collider to check. |
Returns
Type | Description |
---|---|
bool | True if the collider is paired to a snap volume. |
See Also
IsColliderRegisteredToInteractable(in Collider)
Checks if a given collider is paired with an interactable registered with the interaction mananger, or if it is paired to a snap volume.
Declaration
public bool IsColliderRegisteredToInteractable(in Collider colliderToCheck)
Parameters
Type | Name | Description |
---|---|---|
Collider | colliderToCheck | Collider to lookup |
Returns
Type | Description |
---|---|
bool | True if collider is paired to either an interactable directly, or indirectly via a snap volume. |
See Also
IsFocusPossible(IXRInteractor, IXRFocusInteractable)
Whether the given Interactor would be able gain focus of the given Interactable if the Interactor were in a state where it could focus.
Declaration
public bool IsFocusPossible(IXRInteractor interactor, IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor to check. |
IXRFocusInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns whether the given Interactor would be able to gain focus of the given Interactable if the Interactor were in a state where it could focus. |
See Also
IsHandSelecting(InteractorHandedness)
Checks if any registered interactor with the associated handedness is currently selecting any interactable.
Declaration
public bool IsHandSelecting(InteractorHandedness hand)
Parameters
Type | Name | Description |
---|---|---|
InteractorHandedness | hand | Hand to check, such as Left or Right. |
Returns
Type | Description |
---|---|
bool | Returns true if any registered interactor has the given handedness and is selecting any interactable. |
See Also
IsHighestPriorityTarget(IXRSelectInteractable, List<IXRTargetPriorityInteractor>)
Gets whether the given Interactable is the highest priority candidate for selection in this frame, useful for custom feedback. Only IXRTargetPriorityInteractors that are configured to monitor Targets will be considered.
Declaration
public bool IsHighestPriorityTarget(IXRSelectInteractable target, List<IXRTargetPriorityInteractor> interactors = null)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractable | target | The Interactable to check if it's the highest priority candidate for selection. |
List<IXRTargetPriorityInteractor> | interactors | (Optional) Returns the list of Interactors where the given Interactable has the highest priority for selection. |
Returns
Type | Description |
---|---|
bool | Returns true if the given Interactable is the highest priority candidate for selection. Otherwise, returns false. |
Remarks
Clears interactors
before adding to it.
See Also
IsHoverPossible(IXRHoverInteractor, IXRHoverInteractable)
Whether the given Interactor would be able to hover the given Interactable if the Interactor were in a state where it could hover.
Declaration
public bool IsHoverPossible(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to check. |
IXRHoverInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns whether the given Interactor would be able to hover the given Interactable if the Interactor were in a state where it could hover. |
See Also
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 |
---|---|
bool |
See Also
IsRegistered(IXRInteractionGroup)
Checks whether the interactionGroup
is registered with this Interaction Manager.
Declaration
public bool IsRegistered(IXRInteractionGroup interactionGroup)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | interactionGroup | The Interaction Group to check. |
Returns
Type | Description |
---|---|
bool |
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 |
---|---|
bool |
See Also
IsSelectPossible(IXRSelectInteractor, IXRSelectInteractable)
Whether the given Interactor would be able to select the given Interactable if the Interactor were in a state where it could select.
Declaration
public bool IsSelectPossible(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor to check. |
IXRSelectInteractable | interactable | The Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns whether the given Interactor would be able to select the given Interactable if the Interactor were in a state where it could select. |
See Also
LateUpdate()
See MonoBehaviour.
Declaration
protected virtual void LateUpdate()
See Also
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()
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected virtual void OnEnable()
See Also
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(InteractionGroupRegisteredEventArgs)
Automatically called when an Interaction Group is registered with this Interaction Manager.
Notifies the Interaction Group, passing the given args
.
Declaration
protected virtual void OnRegistered(InteractionGroupRegisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractionGroupRegisteredEventArgs | args | Event data containing the registered Interaction Group. |
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(InteractionGroupUnregisteredEventArgs)
Automatically called when an Interaction Group is unregistered from this Interaction Manager.
Notifies the Interaction Group, passing the given args
.
Declaration
protected virtual void OnUnregistered(InteractionGroupUnregisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractionGroupUnregisteredEventArgs | args | Event data containing the unregistered Interaction Group. |
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(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
ProcessHoverFilters(IXRHoverInteractor, IXRHoverInteractable)
Returns the processing value of the filters in hoverFilters for the given Interactor and Interactable.
Declaration
protected bool ProcessHoverFilters(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to be validated by the hover filters. |
IXRHoverInteractable | interactable | The Interactable to be validated by the hover filters. |
Returns
Type | Description |
---|---|
bool | Returns true if all processed filters also return true, or if hoverFilters is empty. Otherwise, returns false. |
See Also
ProcessInteractables(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
ProcessInteractionStrength(UpdatePhase)
Automatically called each frame to process interaction strength of interactables and interactors registered with this manager.
Declaration
protected virtual void ProcessInteractionStrength(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase. |
See Also
ProcessInteractors(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
ProcessSelectFilters(IXRSelectInteractor, IXRSelectInteractable)
Returns the processing value of the filters in selectFilters for the given Interactor and Interactable.
Declaration
protected bool ProcessSelectFilters(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The Interactor to be validated by the select filters. |
IXRSelectInteractable | interactable | The Interactable to be validated by the select filters. |
Returns
Type | Description |
---|---|
bool | Returns true if all processed filters also return true, or if selectFilters is empty. Otherwise, returns false. |
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. |
See Also
RegisterInteractionGroup(IXRInteractionGroup)
Registers a new Interaction Group to be processed.
Declaration
public virtual void RegisterInteractionGroup(IXRInteractionGroup interactionGroup)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | interactionGroup | The Interaction Group to be registered. |
See Also
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. |
See Also
RegisterSnapVolume(XRInteractableSnapVolume)
Registers a new snap volume to associate the snap collider and interactable.
Declaration
public void RegisterSnapVolume(XRInteractableSnapVolume snapVolume)
Parameters
Type | Name | Description |
---|---|---|
XRInteractableSnapVolume | snapVolume | The snap volume to be registered. |
See Also
ResolveExistingFocus(IXRInteractionGroup, IXRFocusInteractable)
Automatically called when gaining focus of an Interactable by an interaction group is initiated and the Interactable is already focused.
Declaration
protected virtual bool ResolveExistingFocus(IXRInteractionGroup interactionGroup, IXRFocusInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | interactionGroup | The interaction group that is gaining focus. |
IXRFocusInteractable | interactable | The Interactable being focused. |
Returns
Type | Description |
---|---|
bool | Returns true if the existing focus was successfully resolved and focus should continue. Otherwise, returns false if the focus should be ignored. |
See Also
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 |
---|---|
bool | 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. |
See Also
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.
See Also
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.
See Also
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. |
See Also
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.
See Also
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 |
---|---|
bool | Returns true if an Interactable was associated with the collider. Otherwise, returns false. |
See Also
TryGetInteractableForCollider(Collider, out IXRInteractable, out XRInteractableSnapVolume)
Gets the Interactable a specific Collider is attached to.
Declaration
public bool TryGetInteractableForCollider(Collider interactableCollider, out IXRInteractable interactable, out XRInteractableSnapVolume snapVolume)
Parameters
Type | Name | Description |
---|---|---|
Collider | interactableCollider | The collider of the Interactable to retrieve. |
IXRInteractable | interactable | The returned Interactable associated with the collider. |
XRInteractableSnapVolume | snapVolume | The returned snap volume associated with the collider. |
Returns
Type | Description |
---|---|
bool | Returns true if an Interactable was associated with the collider. Otherwise, returns false. |
See Also
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. |
See Also
UnregisterInteractionGroup(IXRInteractionGroup)
Unregister an Interaction Group so it is no longer processed.
Declaration
public virtual void UnregisterInteractionGroup(IXRInteractionGroup interactionGroup)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractionGroup | interactionGroup | The Interaction Group to be unregistered. |
See Also
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. |
See Also
UnregisterSnapVolume(XRInteractableSnapVolume)
Unregister the snap volume so it is no longer associated with the snap collider or interactable.
Declaration
public void UnregisterSnapVolume(XRInteractableSnapVolume snapVolume)
Parameters
Type | Name | Description |
---|---|---|
XRInteractableSnapVolume | snapVolume | The snap volume to be unregistered. |
See Also
Update()
See MonoBehaviour.
Declaration
protected virtual void Update()
See Also
Events
focusGained
Calls this method in its invocation list when an IXRInteractionGroup gains focus.
Declaration
public event Action<FocusEnterEventArgs> focusGained
Event Type
Type | Description |
---|---|
Action<FocusEnterEventArgs> |
See Also
focusLost
Calls this method in its invocation list when an IXRInteractionGroup loses focus.
Declaration
public event Action<FocusExitEventArgs> focusLost
Event Type
Type | Description |
---|---|
Action<FocusExitEventArgs> |
See Also
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
interactionGroupRegistered
Calls the methods in its invocation list when an IXRInteractionGroup is registered.
Declaration
public event Action<InteractionGroupRegisteredEventArgs> interactionGroupRegistered
Event Type
Type | Description |
---|---|
Action<InteractionGroupRegisteredEventArgs> |
Remarks
The InteractionGroupRegisteredEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
interactionGroupUnregistered
Calls the methods in its invocation list when an IXRInteractionGroup is unregistered.
Declaration
public event Action<InteractionGroupUnregisteredEventArgs> interactionGroupUnregistered
Event Type
Type | Description |
---|---|
Action<InteractionGroupUnregisteredEventArgs> |
Remarks
The InteractionGroupUnregisteredEventArgs 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.