Class XRHandSubsystem
A subystem for detecting and tracking hands and their corresponding joint pose data.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Hands
Syntax
public class XRHandSubsystem : SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>, ISubsystem
Constructors
XRHandSubsystem()
Constructs a subsystem. Do not invoke directly; call Create
on the XRHandSubsystemDescriptor instead.
Declaration
public XRHandSubsystem()
Fields
handsUpdated
A callback for when hands a call to TryUpdateHands(XRHandSubsystem.UpdateType) completes. Use this if you don't own the subsystem, but want to be made aware of changes, such as if you are driving visuals.
Declaration
public Action<XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> handsUpdated
Field Value
Type | Description |
---|---|
Action<XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> |
Properties
jointsInLayout
Gets a layout array that is marked true for each joint that will
ever by tracked by the provider attached to this subsystem. To
retrieve the matching index, call .ToIndex()
on the
XRHandJointID in question.
Declaration
public NativeArray<bool> jointsInLayout { get; }
Property Value
Type | Description |
---|---|
NativeArray<Boolean> |
Remarks
This array will already be valid as soon as you have a reference to
a subsystem (in other words, it's filled out before the subsystem is
returned by a call to XRHandSubsystemDescriptor.Create
).
leftHand
Gets the left XRHand that is being tracked by this subsystem.
Declaration
public XRHand leftHand { get; }
Property Value
Type | Description |
---|---|
XRHand |
rightHand
Gets the right XRHand that is being tracked by this subsystem.
Declaration
public XRHand rightHand { get; }
Property Value
Type | Description |
---|---|
XRHand |
Methods
OnCreate()
Called by Unity before the subsystem is returned from a call to XRHandSubsystemDescriptor.Create
.
Declaration
protected override void OnCreate()
Overrides
OnDestroy()
Called by Unity before the subsystem is fully destroyed during a call to XRHandSubsystem.Destroy
.
Declaration
protected override void OnDestroy()
Overrides
TryUpdateHands(XRHandSubsystem.UpdateType)
Call this to have the subsystem retrieve changes from the provider. Changes will be reflected in leftHand and rightHand.
Declaration
public virtual XRHandSubsystem.UpdateSuccessFlags TryUpdateHands(XRHandSubsystem.UpdateType updateType)
Parameters
Type | Name | Description |
---|---|---|
XRHandSubsystem.UpdateType | updateType | Informs the provider which kind of timing the update is being requested under. |
Returns
Type | Description |
---|---|
XRHandSubsystem.UpdateSuccessFlags | Returns XRHandSubsystem.UpdateSuccessFlags to describe what data was updated successfully. |
Remarks
If overriding this method in a derived type, it is expected that you
call base.TryUpdateHands(updateType)
and return what it
returns.