Interface IXRHoverInteractor
An interface that represents an Interactor component that can hover over an Interactable component.
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Interactors
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public interface IXRHoverInteractor : IXRInteractor
Properties
hasHover
(Read Only) Indicates whether this Interactor is currently hovering an Interactable.
Declaration
bool hasHover { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
In other words, returns whether interactables
Examples
interactablesHovered.Count > 0
See Also
hoverEntered
The event that is called when this Interactor begins hovering over an Interactable.
Declaration
HoverEnterEvent hoverEntered { get; }
Property Value
Type | Description |
---|---|
Hover |
Remarks
The Hover
See Also
hoverExited
The event that is called when this Interactor ends hovering over an Interactable.
Declaration
HoverExitEvent hoverExited { get; }
Property Value
Type | Description |
---|---|
Hover |
Remarks
The Hover
See Also
interactablesHovered
(Read Only) The list of Interactables that are currently being hovered over (may by empty).
Declaration
List<IXRHoverInteractable> interactablesHovered { get; }
Property Value
Type | Description |
---|---|
List<IXRHover |
Remarks
You should treat this as a read only view of the list and should not modify it.
It is exposed as a List<T> rather than an IRead
See Also
isHoverActive
(Read Only) Indicates whether this Interactor is in a state where it could hover.
Declaration
bool isHoverActive { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
Methods
CanHover(IXRHoverInteractable)
Determines if the Interactable is valid for hover this frame.
Declaration
bool CanHover(IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHover |
interactable | Interactable to check. |
Returns
See Also
IsHovering(IXRHoverInteractable)
Determines whether this Interactor is currently hovering the Interactable.
Declaration
bool IsHovering(IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHover |
interactable | Interactable to check. |
Returns
Type | Description |
---|---|
bool | Returns true if this Interactor is currently hovering the Interactable. Otherwise, returns false. |
Remarks
In other words, returns whether interactablesinteractable
.
See Also
OnHoverEntered(HoverEnterEventArgs)
The XRInteraction
Declaration
void OnHoverEntered(HoverEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Hover |
args | Event data containing the Interactable that is being hovered over. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnHoverEntering(HoverEnterEventArgs)
The XRInteraction
Declaration
void OnHoverEntering(HoverEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Hover |
args | Event data containing the Interactable that is being hovered over. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnHoverExited(HoverExitEventArgs)
The XRInteraction
Declaration
void OnHoverExited(HoverExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Hover |
args | Event data containing the Interactable that is no longer hovered over. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnHoverExiting(HoverExitEventArgs)
The XRInteraction
Declaration
void OnHoverExiting(HoverExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Hover |
args | Event data containing the Interactable that is no longer hovered over. |
Remarks
args
is only valid during this method call, do not hold a reference to it.