Class XRHandTrackingEvents
Component that subscribes to hand tracking events from the XRHandSubsystem for a particular Handedness and sends UnityEvents for tracking updates.
Inherited Members
Namespace: UnityEngine.XR.Hands
Syntax
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.hands@1.1/api/UnityEngine.XR.Hands.XRHandTrackingEvents.html")]
public class XRHandTrackingEvents : MonoBehaviour
Properties
bindableHandIsTracked
Whether the hand is currently being tracked, stored as a bindable variable that can be subscribed to for value changes.
Declaration
public IReadOnlyBindableVariable<bool> bindableHandIsTracked { get; }
Property Value
Type | Description |
---|---|
IReadOnlyBindableVariable<Boolean> |
handedness
The hand to track and send events for.
Declaration
public Handedness handedness { get; set; }
Property Value
Type | Description |
---|---|
Handedness |
handIsTracked
Whether the hand is currently being tracked
Declaration
public bool handIsTracked { get; }
Property Value
Type | Description |
---|---|
Boolean |
jointsUpdated
Event that occurs when the joints of the hands have updated.
Declaration
public HandUpdatedEvent jointsUpdated { get; }
Property Value
Type | Description |
---|---|
HandUpdatedEvent |
Remarks
The XRHandJointsUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
poseUpdated
Event that occurs when the pose of the hands has updated.
Declaration
public UnityEvent<Pose> poseUpdated { get; }
Property Value
Type | Description |
---|---|
UnityEvent<Pose> |
rootPose
The root pose of the hand.
Declaration
public Pose rootPose { get; }
Property Value
Type | Description |
---|---|
Pose |
trackingAcquired
Event that occurs when the hand tracking is acquired.
Declaration
public UnityEvent trackingAcquired { get; }
Property Value
Type | Description |
---|---|
UnityEvent |
trackingChanged
Event that occurs when the hand tracking is acquired (true) or lost (false).
Declaration
public UnityEvent<bool> trackingChanged { get; }
Property Value
Type | Description |
---|---|
UnityEvent<Boolean> |
trackingLost
Event that occurs when the hand tracking is lost.
Declaration
public UnityEvent trackingLost { get; }
Property Value
Type | Description |
---|---|
UnityEvent |
updateType
Which update type to send events for when the pose and joints are updated. This can be one or multiple options from XRHandSubsystem.UpdateType.
Declaration
public XRHandTrackingEvents.UpdateTypes updateType { get; set; }
Property Value
Type | Description |
---|---|
XRHandTrackingEvents.UpdateTypes |
See Also
Methods
OnDisable()
See MonoBehaviour.
Declaration
protected virtual void OnDisable()
Update()
See MonoBehaviour.
Declaration
protected virtual void Update()