### XRHandProviderUtility.SubsystemUpdater.Start Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandProviderUtility.SubsystemUpdater.html Starts the automatic updating of the XRHandSubsystem. Call this when starting the subsystem in your plugin. ```csharp public void Start() ``` -------------------------------- ### OnSubsystemStart Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html This method is called after the OpenXR loader has started its subsystems. It initiates the XRHandSubsystem and its automatic updating. ```APIDOC ## OnSubsystemStart() ### Description Called after the OpenXR loader has started its subsystems. Starts the XRHandSubsystem and automatic updating for it. To subscribe to updates, use handsUpdated. ### Method protected override void OnSubsystemStart() ``` -------------------------------- ### Get XRHandSubsystem Instance Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Demonstrates how to get an instance of the XRHandSubsystem from the active XR loader. This is the recommended way to access hand tracking data. ```csharp using UnityEngine; using UnityEngine.XR.Hands; public class HandTrackingManager : MonoBehaviour { private XRHandSubsystem handSubsystem; void Start() { // Get the XRHandSubsystem from the active XR loader handSubsystem = HandSubsystemManager.instance.TryGetSubsystem(); if (handSubsystem == null) { Debug.LogError("XRHandSubsystem not found. Make sure hand tracking is enabled in your XR project settings."); } } // ... rest of your script } ``` -------------------------------- ### MetaHandTrackingAim OnSubsystemStart Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.MetaHandTrackingAim.html Overrides the OnSubsystemStart method from the base OpenXRFeature class. This method is called when the subsystem starts. ```csharp protected override void OnSubsystemStart() { } ``` -------------------------------- ### Ensure Subsystem Initialization Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html Manually ensures that an XRHandSubsystem is created. It will automatically start the subsystem if the session is running. ```csharp public static void EnsureSubsystemInitialized() ``` -------------------------------- ### Automatic Subsystem Initialization Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html Controls whether an XRHandSubsystem is automatically created when the OpenXR session starts. Defaults to true. ```csharp public static bool automaticallyInitializeSubsystem { get; set; } ``` -------------------------------- ### Toggle Hand Tracking with OpenXRHandSubsystemManager Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/manual/openxr-features/openxr-hand-subsystem-manager.html This sample demonstrates how to use the OpenXRHandSubsystemManager to start and stop hand tracking. It includes logic to find the manager, and methods to enable or disable it based on permission status. ```csharp #if UNITY_OPENXR_PACKAGE using UnityEngine; using UnityEngine.XR.Hands.OpenXR; /// /// A sample demonstrating how to use the /// to start and stop hand tracking based on platform-specific permission requests. /// public class SubsystemManagerSample : MonoBehaviour { [SerializeField] OpenXRHandSubsystemManager handSubsystemManager; void Awake() { if (handSubsystemManager == null) { handSubsystemManager = FindAnyObjectByType(); } } void Start() { // Make some platform-specific permission requests } /// /// Called when permission for hand tracking is granted. /// public void OnPermissionGranted() { // Start hand tracking handSubsystemManager.enabled = true; } /// /// Called when permission for hand tracking is denied. /// public void OnPermissionDenied() { // Stop hand tracking handSubsystemManager.enabled = false; } } #endif // UNITY_OPENXR_PACKAGE ``` -------------------------------- ### Initialize a New XR Hand Recording Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingBlob.html Attempts to initialize a new hand recording session. Call this before starting to capture data. Initialization can fail if a recording is already in progress or the XRHandSubsystem is unavailable. ```csharp public bool TryInitialize(XRHandRecordingInitializeArgs args) ``` -------------------------------- ### TryGetGraspFirmState Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRCommonHandGestures.html Attempts to get whether the user is making a fist. Returns true if data is available, and sets isGraspFirm to indicate the state. ```APIDOC ## TryGetGraspFirmState ### Description Attempts to get whether the user is making a fist (firm grasp). Returns `true` if data is available and `isGraspFirm` is set accordingly. If data is not available, it returns `false` and `isGraspFirm` will be `false`. ### Method `public bool TryGetGraspFirmState(out bool isGraspFirm)` ### Parameters #### Output Parameters - **isGraspFirm** (bool) - Will be set to `true` if the user is making a fist, otherwise `false`. ### Returns - **bool** - Returns `true` if a valid evaluation of the gesture is available. Returns `false` otherwise. ### Remarks Data to evaluate the gesture might not be available when you call this function. When data is available, the function returns `true` and sets `isGraspFirm` to indicate whether the user is making a fist (firm grasp). If this function returns `false`, `isGraspFirm` will be `false` whether or not the user is making a fist. ``` -------------------------------- ### Enable OpenXR Hand Subsystem Manager Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/manual/openxr-features/openxr-hand-subsystem-manager.html Enable the OpenXRHandSubsystemManager component in your code to start hand tracking after a condition is met, such as granting user permission. ```csharp handSubsystemManager.enabled = true; ``` -------------------------------- ### Get XRHandSubsystem Instance Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/manual/hand-data/xr-hand-access-data.html Retrieves the XRHandSubsystem instance from the active XR loader. Ensure the XR system has finished initialization before calling this. ```csharp using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.Hands; // ... var handSubsystems = new List(); SubsystemManager.GetSubsystems(handSubsystems); ``` -------------------------------- ### TryGetGraspFirmState in C# Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Gets whether the user is making a fist. This method should only be called if the system supports grasp value detection. ```csharp public virtual bool TryGetGraspFirmState(Handedness handedness, out bool isGraspFirm) ``` -------------------------------- ### XRCommonHandGestures.AimActivatedStateUpdatedEventArgs.TryGetAimActivatedState Method - Usage Example Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRCommonHandGestures.AimActivatedStateUpdatedEventArgs.html Demonstrates how to use the TryGetAimActivatedState method to check if aim is activated. Note that data might not be available when the event is dispatched. ```csharp bool isAimActivated; if (args.TryGetAimActivatedState(out isAimActivated)) { // Aim is activated if isAimActivated is true } ``` -------------------------------- ### XRHandDevice FinishSetup() Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandDevice.html Performs final initialization tasks for the control hierarchy. ```csharp protected override void FinishSetup() ``` -------------------------------- ### Get Common Gestures by Handedness Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Gets the XRCommonHandGestures associated with the given Handedness. Throws an exception if anything other than Left or Right is supplied. ```csharp XRCommonHandGestures commonGestures = xrHandSubsystem.GetCommonGestures(Handedness.Left); ``` -------------------------------- ### Try Get Grip Pose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.OpenXRHandProvider.html Attempts to retrieve the grip pose for a given hand. This method is only called if `supportsGripPose` is enabled. It returns true if the pose was successfully retrieved and filled out, false otherwise. ```csharp public override bool TryGetGripPose(Handedness handedness, out Pose gripPose) { // Implementation details omitted for brevity gripPose = Pose.identity; // Default value return false; // Default return value } ``` -------------------------------- ### Try Get Aim State Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.OpenXRHandProvider.html Attempts to get the aim state for the specified hand. Returns true if the aim state was successfully retrieved and filled out, false otherwise. ```csharp public override bool TryGetAimState(Handedness handedness, out XRHandAimState aimState) { // Implementation details omitted for brevity aimState = default(XRHandAimState); // Default value return false; // Default return value } ``` -------------------------------- ### Sample: Managing Hand Tracking Permissions with OpenXR Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.OpenXRHandSubsystemManager.html This example demonstrates how to use OpenXRHandSubsystemManager to enable or disable hand tracking based on platform-specific permission requests. It includes logic for finding the manager and responding to permission granted or denied events. ```csharp #if UNITY_OPENXR_PACKAGE using UnityEngine; using UnityEngine.XR.Hands.OpenXR; /// /// A sample demonstrating how to use the /// to start and stop hand tracking based on platform-specific permission requests. /// public class SubsystemManagerSample : MonoBehaviour { [SerializeField] OpenXRHandSubsystemManager handSubsystemManager; void Awake() { if (handSubsystemManager == null) { handSubsystemManager = FindAnyObjectByType(); } } void Start() { // Make some platform-specific permission requests } /// /// Called when permission for hand tracking is granted. /// public void OnPermissionGranted() { // Start hand tracking handSubsystemManager.enabled = true; } /// /// Called when permission for hand tracking is denied. /// public void OnPermissionDenied() { // Stop hand tracking handSubsystemManager.enabled = false; } } #endif // UNITY_OPENXR_PACKAGE ``` -------------------------------- ### GetHand Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Gets the XRHand associated with the given Handedness. ```APIDOC ## GetHand(Handedness) ### Description Gets the XRHand associated with the given Handedness. ### Method public XRHand GetHand(Handedness handedness) ### Parameters #### Path Parameters - **handedness** (Handedness) - Required - The Handedness you wish to retrieve the associated XRHand for. `GetHand` will throw an exception if anything other than Left or Right is supplied. ### Returns - **XRHand** - The XRHand associated with the given Handedness. ### Remarks Will only ever return either leftHand or rightHand. ``` -------------------------------- ### TryGetHand Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Attempts to get the XRHand associated with the given Handedness. ```APIDOC ## TryGetHand(Handedness, out XRHand) ### Description Attempts to get the XRHand associated with the given Handedness. ### Method public bool TryGetHand(Handedness handedness, out XRHand hand) ### Parameters #### Path Parameters - **handedness** (Handedness) - Required - The Handedness you wish to retrieve the associated XRHand for. - **hand** (XRHand) - Required - If `TryGetHand` returns true, this will be filled out with the associated hand data requested. ### Returns - **bool** - Returns true if a valid Left or Right hand was requested and the subsystem is initialized, returns false otherwise. ### Remarks Will only ever successfully retrieve either leftHand or rightHand. ``` -------------------------------- ### TryGetCommonGestures Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Attempts to get the XRCommonHandGestures associated with the given Handedness. ```APIDOC ## TryGetCommonGestures(Handedness, out XRCommonHandGestures) ### Description Attempts to get the XRCommonHandGestures associated with the given Handedness. ### Method public bool TryGetCommonGestures(Handedness handedness, out XRCommonHandGestures commonGestures) ### Parameters #### Path Parameters - **handedness** (Handedness) - Required - The Handedness you wish to retrieve the associated XRCommonHandGestures for. - **commonGestures** (XRCommonHandGestures) - Required - If `TryGetCommonGestures` returns true, this will be filled out with the associated common gestures data requested. ### Returns - **bool** - Returns true if a valid Left or Right hand was requested and the subsystem is initialized, returns false otherwise. ### Remarks Will only ever successfully retrieve either leftHandCommonGestures or rightHandCommonGestures. ``` -------------------------------- ### FinishSetup Method Declaration Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.MetaAimHand.html Performs final initialization tasks after the control hierarchy has been put into place. This method overrides TrackedDevice.FinishSetup(). ```csharp protected override void FinishSetup() ``` -------------------------------- ### XRHandRecordingInitializeArgs Syntax Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingInitializeArgs.html Defines the structure for initializing hand recordings. It implements the IEquatable interface for value comparisons. ```csharp public readonly struct XRHandRecordingInitializeArgs : IEquatable ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo id Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html Sets or gets a string identifier for the subsystem provider. ```csharp public string id { readonly get; set; } ``` -------------------------------- ### XRHand Properties Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHand.html Access properties of the XRHand struct to get information about the tracked hand. ```APIDOC ## XRHand Properties ### handedness Represents which hand this is. - **Declaration** ``` public Handedness handedness { get; } ``` - **Property Value** - **Type**: Handedness - **Description**: Right, left, or invalid. ### isTracked Whether the subsystem is currently tracking this hand's root pose and joints. - **Declaration** ``` public bool isTracked { get; } ``` - **Property Value** - **Type**: bool - **Description**: Indicates the tracking status as of the last hand data update. ### rootPose Root pose for the hand. - **Declaration** ``` public Pose rootPose { get; } ``` - **Property Value** - **Type**: Pose - **Description**: Located at the wrist joint, the forward vector of the hand points in the direction of the fingers. ``` -------------------------------- ### XRHandCaptureSequence Properties Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.XRHandCaptureSequence.html Access properties of XRHandCaptureSequence to get information about the captured hand data. ```csharp public bool canSurfaceCommonPoseData { get; } ``` ```csharp public XRDetectedHandMeshLayout detectedHandMeshLayout { get; } ``` ```csharp public float durationInSeconds { get; } ``` ```csharp public IReadOnlyList frames { get; } ``` -------------------------------- ### EnsureSubsystemInitialized() Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html Ensures that an XRHandSubsystem is created and ready for use. This method is automatically called at startup if automatic initialization is enabled. ```APIDOC ### Methods #### EnsureSubsystemInitialized() Ensures an XRHandSubsystem is created. ```csharp public static void EnsureSubsystemInitialized() ``` **Remarks** Will be automatically called at start-up if automaticallyInitializeSubsystem is true, which it is by default. If called later, will automatically start the subsystem if the session is running. ``` -------------------------------- ### Handedness Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandTrackingEvents.html Set or get the specific hand (left or right) for which tracking events will be sent. ```csharp public Handedness handedness { get; set; } ``` -------------------------------- ### Create XRHandSubsystem with OpenXR Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html This method is called when an XR session is created. It is responsible for initializing the XRHandSubsystem using the OpenXR provider. ```csharp protected override void OnSessionCreate(ulong xrSession) { } ``` -------------------------------- ### TryGetPokePose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRCommonHandGestures.html Attempts to get the poke pose. Returns true if successful and fills the pokePose out parameter. ```APIDOC ## TryGetPokePose ### Description Attempts to get the poke pose of the hand. Returns `true` if the pose was successfully retrieved, and `false` otherwise. ### Method `public bool TryGetPokePose(out Pose pokePose)` ### Parameters #### Output Parameters - **pokePose** (Pose) - Will be filled out with the poke pose, if successful. ### Returns - **bool** - Returns `true` if successful, returns `false` otherwise. ``` -------------------------------- ### HandTracking.SubsystemCreatedEventArgs Syntax Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.SubsystemCreatedEventArgs.html This snippet shows the basic syntax for the HandTracking.SubsystemCreatedEventArgs struct within the UnityEngine.XR.Hands.OpenXR namespace. ```csharp public struct HandTracking.SubsystemCreatedEventArgs { } ``` -------------------------------- ### On Instance Create Override Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html Overrides the base method to handle the creation of an OpenXR instance. ```csharp protected override bool OnInstanceCreate(ulong xrInstance) ``` -------------------------------- ### TryGetPinchValue Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRCommonHandGestures.html Attempts to get the pinch value. Returns true and fills the pinchValue out parameter if successful. ```APIDOC ## TryGetPinchValue ### Description Attempts to get the current pinch value. Returns `true` and fills the `pinchValue` out parameter if a valid value is obtained, otherwise returns `false`. ### Method `public bool TryGetPinchValue(out float pinchValue)` ### Parameters #### Output Parameters - **pinchValue** (float) - Will be filled out with the pinch value, if successful. ### Returns - **bool** - Returns `true` and a valid value is filled out. Returns `false` otherwise. ``` -------------------------------- ### TryGetPinchPose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRCommonHandGestures.html Attempts to get the pinch pose. Returns true if successful and fills the pinchPose out parameter. ```APIDOC ## TryGetPinchPose ### Description Attempts to get the pinch pose of the hand. Returns `true` if the pose was successfully retrieved, and `false` otherwise. ### Method `public bool TryGetPinchPose(out Pose pinchPose)` ### Parameters #### Output Parameters - **pinchPose** (Pose) - Will be filled out with the pinch pose, if successful. ### Returns - **bool** - Returns `true` if successful, returns `false` otherwise. ``` -------------------------------- ### OnSubsystemStop Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html This method is called before the OpenXR loader stops its subsystems. It halts the XRHandSubsystem and its automatic updating. ```APIDOC ## OnSubsystemStop() ### Description Called before the OpenXR loader stops its subsystems. Stops the XRHandSubsystem and automatic updating for it. ### Method protected override void OnSubsystemStop() ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo supportsPinchPose Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html Indicates whether the provider can supply the pinch pose. ```csharp public bool supportsPinchPose { readonly get; set; } ``` -------------------------------- ### XRHandRelativeOrientation.targetTransform Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Gestures.XRHandRelativeOrientation.html Set or get the target Transform to which the targetConditions are relative. This property is not used for userConditions. ```csharp public Transform targetTransform { get; set; } ``` -------------------------------- ### XRHandRecordingInitializeArgs Equals(XRHandRecordingInitializeArgs) Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingInitializeArgs.html Compares the current XRHandRecordingInitializeArgs instance with another XRHandRecordingInitializeArgs for equality. Returns true if all fields match. ```csharp public bool Equals(XRHandRecordingInitializeArgs other) ``` -------------------------------- ### Create XRHand Instance Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandProviderUtility.html Creates and initializes a new XRHand instance. Use this for advanced scenarios requiring direct XRHand control outside of XRHandSubsystem. ```csharp public static XRHand CreateHand(Handedness handedness, Allocator allocator) ``` -------------------------------- ### TryGetPokePose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Gets the poke pose for a specified hand. This method should only be called if poke pose support is enabled. ```APIDOC ## TryGetPokePose ### Description Gets the poke pose for a specified hand. This method is intended to be called only when `supportsPokePose` is enabled. ### Method `public virtual bool TryGetPokePose(Handedness handedness, out Pose pokePose)` ### Parameters #### Path Parameters - **handedness** (Handedness) - Description: Which hand to retrieve data for. - **pokePose** (out Pose) - Description: The pose to update the poke pose to, if available. Will not be used if `false` is returned. ### Returns - **bool** - Returns `true` if successful and the poke pose was filled out, returns `false` otherwise. ``` -------------------------------- ### TryGetPinchValue Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Gets the pinch value for a specified hand. This method should only be called if pinch value support is enabled. ```APIDOC ## TryGetPinchValue ### Description Gets the pinch value for a specified hand. This method should only be called if `supportsPinchValue` is enabled. ### Method `public virtual bool TryGetPinchValue(Handedness handedness, out float pinchValue)` ### Parameters #### Path Parameters - **handedness** (Handedness) - Description: Which hand to retrieve data for. - **pinchValue** (out float) - Description: The pinch value, if available. Will not be used if `false` is returned. ### Returns - **bool** - Returns `true` if successful and the grasp value was filled out, returns `false` otherwise. ``` -------------------------------- ### Registering a Subsystem Descriptor Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/manual/implement-a-provider.html This C# code demonstrates how to define a hand subsystem provider and subsystem, and register its descriptor with Unity's SubsystemManager. It includes the necessary attribute for runtime initialization. ```csharp class MyHandProvider : XRHandSubsystemProvider { // ... } class MyHandSubsystem : XRHandSubsystem { public int myPlatformSpecificData => provider.RetrievePlatformSpecificData(); [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] static void RegisterDescriptor() { var handsSubsystemCinfo = new XRHandSubsystemDescriptor.Cinfo { id = "My-Hands", providerType = typeof(MyHandProvider), subsystemTypeOverride = typeof(MyHandSubsystem) }; XRHandSubsystemDescriptor.Register(handsSubsystemCinfo); } } ``` -------------------------------- ### TryGetPinchPose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Gets the pinch pose for a specified hand. This method should only be called if pinch pose support is enabled. ```APIDOC ## TryGetPinchPose ### Description Gets the pinch pose for a specified hand. This method is intended to be called only when `supportsPinchPose` is enabled. ### Method `public virtual bool TryGetPinchPose(Handedness handedness, out Pose pinchPose)` ### Parameters #### Path Parameters - **handedness** (Handedness) - Description: Which hand to retrieve data for. - **pinchPose** (out Pose) - Description: The pose to update the pinch pose to, if available. Will not be used if `false` is returned. ### Returns - **bool** - Returns `true` if successful and the pinch pose was filled out, returns `false` otherwise. ``` -------------------------------- ### XRHandSubsystem Constructor Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html The XRHandSubsystem constructor. Application developers should not call this directly; instead, obtain an instance via the XR loader. ```csharp public XRHandSubsystem() ``` -------------------------------- ### HandTracking.SubsystemCreatedEventArgs Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.html Event-args struct passed to subsystemCreated when the subsystem is created. ```APIDOC ## Struct: HandTracking.SubsystemCreatedEventArgs ### Description Event-args struct passed to subsystemCreated when the subsystem is created. ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo Methods Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html This snippet outlines the methods available on the XRHandSubsystemDescriptor.Cinfo struct, including equality checks. ```APIDOC ## Struct XRHandSubsystemDescriptor.Cinfo ### Methods #### Equals(object) Tests for equality. - **Parameters**: - obj (object): The `object` to compare against. - **Returns**: bool - Returns true if `obj` is of type XRHandSubsystemDescriptor.Cinfo and Equals(Cinfo) also returns true; otherwise returns false. #### Equals(Cinfo) Tests for equality. - **Parameters**: - other (XRHandSubsystemDescriptor.Cinfo): The other XRHandSubsystemDescriptor.Cinfo to compare against. - **Returns**: bool - Returns true if every field in `other` is equal to this XRHandSubsystemDescriptor.Cinfo, otherwise returns false. #### GetHashCode() Generates a hash suitable for use with containers like `HashSet` and `Dictionary`. - **Returns**: int - A hash code generated from this object's fields. ``` -------------------------------- ### JointToTransformReference.xrHandJointID Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.JointToTransformReference.html The XRHandJointID that will drive the Transform. This property allows you to get or set the specific hand joint identifier. ```csharp public XRHandJointID xrHandJointID { get; set; } ``` -------------------------------- ### XRHandRecordingBlob Constructors Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingBlob.html Provides constructors for creating and initializing XRHandRecordingBlob objects. ```APIDOC ## XRHandRecordingBlob() ### Description Creates a new instance of the XRHandRecordingBlob class. ### Syntax ```csharp public XRHandRecordingBlob() ``` ``` -------------------------------- ### Getting Detected Hand Mesh Layout Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Retrieves the XRDetectedHandMeshLayout, which describes the version of authored hand meshes detected for use. ```csharp XRDetectedHandMeshLayout layout = xrHandSubsystem.detectedHandMeshLayout; ``` -------------------------------- ### XRHandRecordingInitializeArgs Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingInitializeArgs.html The XRHandRecordingInitializeArgs struct is used to provide the necessary parameters when initializing a new hand recording session. It requires a running XRHandSubsystem to capture data. ```APIDOC ## Struct XRHandRecordingInitializeArgs The arguments required to initialize a new recording. ### Properties #### subsystem The XRHandSubsystem to capture hand data from. ##### Declaration ```csharp public XRHandSubsystem subsystem { get; init; } ``` ##### Property Value Type | Description ---|--- XRHandSubsystem | The XRHandSubsystem to capture hand data from. ##### Remarks The subsystem is expected to be running for the duration of the recording. If the subsystem is stopped, unexpected behavior may occur. ### Methods #### Equals(object) Tests for equality. ##### Declaration ```csharp public override bool Equals(object obj) ``` ##### Parameters Type | Name | Description ---|---|--- object | obj | The `object` to compare against. ##### Returns Type | Description ---|--- bool | Returns true if `obj` is of type XRHandRecordingInitializeArgs and Equals(XRHandRecordingInitializeArgs) also returns true; otherwise returns false. #### Equals(XRHandRecordingInitializeArgs) Tests for equality. ##### Declaration ```csharp public bool Equals(XRHandRecordingInitializeArgs other) ``` ##### Parameters Type | Name | Description ---|---|--- XRHandRecordingInitializeArgs | other | The XRHandRecordingInitializeArgs to compare against. ##### Returns Type | Description ---|--- bool | Returns true if every field in `other` is equal to this XRHandRecordingInitializeArgs. Returns false otherwise. #### GetHashCode() Computes a hash code from all fields of XRHandRecordingInitializeArgs. ##### Declaration ```csharp public override int GetHashCode() ``` ##### Returns Type | Description ---|--- int | Returns a hash code of this object. ### Operators #### operator ==(XRHandRecordingInitializeArgs, XRHandRecordingInitializeArgs) Tests for equality. Same as Equals(XRHandRecordingInitializeArgs). ##### Declaration ```csharp public static bool operator ==(XRHandRecordingInitializeArgs lhs, XRHandRecordingInitializeArgs rhs) ``` ##### Parameters Type | Name | Description ---|---|--- XRHandRecordingInitializeArgs | lhs | The left-hand side of the comparison. XRHandRecordingInitializeArgs | rhs | The right-hand side of the comparison. ##### Returns Type | Description ---|--- bool | Returns true if `lhs` is equal to `rhs`, otherwise returns false. #### operator !=(XRHandRecordingInitializeArgs, XRHandRecordingInitializeArgs) Tests for inequality. Same as `!`Equals(XRHandRecordingInitializeArgs). ##### Declaration ```csharp public static bool operator !=(XRHandRecordingInitializeArgs lhs, XRHandRecordingInitializeArgs rhs) ``` ##### Parameters Type | Name | Description ---|---|--- XRHandRecordingInitializeArgs | lhs | The left-hand side of the comparison. XRHandRecordingInitializeArgs | rhs | The right-hand side of the comparison. ##### Returns Type | Description ---|--- bool | Returns true if `lhs` is not equal to `rhs`, otherwise returns false. ``` -------------------------------- ### TryGetAimActivatedState Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRCommonHandGestures.html Attempts to get the aim activation state. Returns true if data is available, and sets isAimActivated to indicate the state. ```APIDOC ## TryGetAimActivatedState ### Description Attempts to get the aim activation state. This method returns `true` if data is available and `isAimActivated` is set accordingly. If data is not available, it returns `false` and `isAimActivated` will be `false`. ### Method `public bool TryGetAimActivatedState(out bool isAimActivated)` ### Parameters #### Output Parameters - **isAimActivated** (bool) - Will be set to `true` if the aim is fully activated, otherwise `false`. ### Returns - **bool** - Returns `true` if a valid evaluation of the activation state is available. Returns `false` otherwise. ### Remarks Data to evaluate the aim activation state might not be available when you call this function. When data is available, the function returns `true` and sets `isAimActivated` to indicate whether the aim is fully activated. If this function returns `false`, `isAimActivated` will be `false` whether or not the aim is actually activated. ``` -------------------------------- ### XRHandAimState Methods Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandAimState.html Provides methods for comparing XRHandAimState instances and retrieving the aim pose. ```APIDOC ## Struct XRHandAimState ### Methods #### Equals(object) Tests for equality. - **Parameters**: - `obj` (`object`) - The `object` to compare against. - **Returns**: `bool` - Returns true if `obj` is of type XRHandAimState and Equals(in XRHandAimState) also returns true; otherwise returns false. #### Equals(in XRHandAimState) Tests for equality. - **Parameters**: - `other` (`XRHandAimState`) - The XRHandAimState to compare against. - **Returns**: `bool` - Returns true if every field in `other` is equal to this XRHandAimState. Returns false otherwise. #### GetHashCode() Computes a hash code from all fields of this `XRHandAimState`. - **Returns**: `int` - Returns a hash code of this object. #### TryGetAimPose(out Pose) Attempts to retrieve the aim Pose. - **Parameters**: - `aimPose` (`out Pose`) - If `TryGetAimPose` returns true, this will be filled out with a valid aim Pose. - **Returns**: `bool` - True if the aim pose was successfully retrieved, false otherwise. ``` -------------------------------- ### Get XRHandJoint Radius Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandJoint.html Retrieves the radius of the XRHandJoint. Use this when you need to know the physical size or extent of a tracked joint. ```csharp public bool TryGetRadius(out float radius) ``` -------------------------------- ### XRHandMeshData TryGetRootPose Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Meshing.XRHandMeshData.html Attempts to retrieve the root pose for the hand mesh data. Returns true if successful, otherwise false. ```csharp public bool TryGetRootPose(out Pose rootPose) { } ``` -------------------------------- ### TryGetPinchTouchedState Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Gets whether the hand is currently performing a pinch gesture. This method should only be called if pinch value support is enabled. ```APIDOC ## TryGetPinchTouchedState ### Description Gets whether the hand is performing a pinch gesture. This method should only be called if `supportsPinchValue` is enabled. Data to evaluate the gesture might not be available when this function is called. When data is available, the function returns `true` and sets `isPinched` to indicate whether the hand is currently pinching. If this function returns `false`, `isPinched` will be `false` whether or not the hand is pinching. ### Method `public virtual bool TryGetPinchTouchedState(Handedness handedness, out bool isPinched)` ### Parameters #### Path Parameters - **handedness** (Handedness) - Description: Which hand to retrieve data for. - **isPinched** (out bool) - Description: Will be set to `true` if the user is pinching; otherwise, `false`. ### Returns - **bool** - Returns `true` if the `isPinched` value was set based on valid data. Returns `false` if the state of the user's hand wasn't available. ``` -------------------------------- ### Get Poke Pose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Retrieves the poke pose for a specified hand. This method is only called if poke pose support is enabled. ```csharp public virtual bool TryGetPokePose(Handedness handedness, out Pose pokePose) ``` -------------------------------- ### OnSessionCreate Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html This method is called when an XR session is created. It is responsible for initializing the XRHandSubsystem with the OpenXR provider. ```APIDOC ## OnSessionCreate(ulong xrSession) ### Description Creates an XRHandSubsystem with the OpenXR provider. ### Method protected override void OnSessionCreate(ulong xrSession) ### Parameters #### Path Parameters - **xrSession** (ulong) - Description: (No description provided in source) ``` -------------------------------- ### Get Pinch Value Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Retrieves the pinch value for a specified hand. This method is only called if pinch value support is enabled. ```csharp public virtual bool TryGetPinchValue(Handedness handedness, out float pinchValue) ``` -------------------------------- ### Get Pinch Pose Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Retrieves the pinch pose for a specified hand. This method is only called if pinch pose support is enabled. ```csharp public virtual bool TryGetPinchPose(Handedness handedness, out Pose pinchPose) ``` -------------------------------- ### XRHandRecordingBlob Constructor Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingBlob.html Creates a new instance of the XRHandRecordingBlob class. ```csharp public XRHandRecordingBlob() ``` -------------------------------- ### TryGetGraspValue in C# Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Gets the grasp value for a specified hand. This method should only be called if the system supports grasp value detection. ```csharp public virtual bool TryGetGraspValue(Handedness handedness, out float graspValue) ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo Syntax Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html Defines the structure for XRHandSubsystemDescriptor.Cinfo, which implements IEquatable. ```csharp public struct XRHandSubsystemDescriptor.Cinfo : IEquatable ``` -------------------------------- ### XRHandRecordingInitializeArgs GetHashCode() Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingInitializeArgs.html Computes and returns a hash code for the XRHandRecordingInitializeArgs instance, suitable for use in hash-based collections. ```csharp public override int GetHashCode() ``` -------------------------------- ### TryGetAimState in C# Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider.html Attempts to get the aim state for a given hand. This method is used to determine if the aim gesture is activated. ```csharp public virtual bool TryGetAimState(Handedness handedness, out XRHandAimState aimState) ``` -------------------------------- ### XRHandProviderUtility.SubsystemUpdater Constructor Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.ProviderImplementation.XRHandProviderUtility.SubsystemUpdater.html Initializes a new instance of the XRHandProviderUtility.SubsystemUpdater class. This should be called once in your plugin after the XRHandSubsystem is created. ```csharp public SubsystemUpdater(XRHandSubsystem subsystem) ``` -------------------------------- ### xrHandCustomGestureDebugActive Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandAnalyticsFlags.html This property indicates if the XRHandShapeDebugUI was used in the editor during Play Mode with analytics enabled. It is a boolean that can be get and set. ```csharp public static bool xrHandCustomGestureDebugActive { get; set; } ``` -------------------------------- ### MetaAimHandState Constructor Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.MetaAimHandState.html Creates a MetaAimHandState from an XRHandAimState. Use this to convert platform-agnostic aim data into the Meta-specific representation. ```csharp public MetaAimHandState(in XRHandAimState aimState) ``` -------------------------------- ### Get Validation Checks Override Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.OpenXR.HandTracking.html Overrides the base method to provide custom validation checks for the build target group. ```csharp protected override void GetValidationChecks(List results, BuildTargetGroup targetGroup) ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo supportsPokePose Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html Indicates whether the provider can supply the poke pose. ```csharp public bool supportsPokePose { readonly get; set; } ``` -------------------------------- ### Retrieve Tip Curl of a Finger Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Gestures.XRFingerShape.html Safely attempts to get the tip curl value for a finger. Returns true if successful. ```csharp public readonly bool TryGetTipCurl(out float tipCurl) ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo supportsGripPose Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html Indicates whether the provider can supply the grip pose. ```csharp public bool supportsGripPose { readonly get; set; } ``` -------------------------------- ### XRHandRecordingInitializeArgs Equals(object) Method Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.Capture.Recording.XRHandRecordingInitializeArgs.html Compares the current XRHandRecordingInitializeArgs instance with another object for equality. It checks if the object is of the correct type and then performs a value-based comparison. ```csharp public override bool Equals(object obj) ``` -------------------------------- ### Getting Common Gestures for Right Hand Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystem.html Retrieves the XRCommonHandGestures for the right hand. This is a convenient way to access common gesture functionalities. ```csharp XRCommonHandGestures rightGestures = xrHandSubsystem.rightHandCommonGestures; ``` -------------------------------- ### XRHandSubsystemDescriptor.Cinfo supportsAimPose Property Source: https://docs.unity3d.com/Packages/com.unity.xr.hands%401.8/api/UnityEngine.XR.Hands.XRHandSubsystemDescriptor.Cinfo.html Indicates whether the provider can supply the aim pose. ```csharp public bool supportsAimPose { readonly get; set; } ```