Class XRHandRecordingBlob
Manages the state and data for a single XR hand recording session. This class manages the lifecycle of a recording, including capturing data from the XRHandSubsystem, saving and deleting the data.
Implements
Inherited Members
Namespace: UnityEngine.XR.Hands.Capture.Recording
Assembly: Unity.XR.Hands.dll
Syntax
public class XRHandRecordingBlob : XRHandRecordingBase, IDisposable
Constructors
XRHandRecordingBlob()
Creates a new instance of the XRHandRecordingBlob class.
Declaration
public XRHandRecordingBlob()
Methods
Clear()
Clears the recording blob and release the memory used by the captured data.
Declaration
public void Clear()
Remarks
This method clears all captured data and unsubscribes from hand tracking updates, while preserving metadata like the asset name and elapsed time. To make the object ready for a completely new recording, call Reset() instead.
Delete()
Deletes the saved file of this recording from the device's storage.
Declaration
public override void Delete()
Overrides
Remarks
Only call this method after the recording has been successfully saved. To dispose an unsaved recording, use Dispose() instead.
Dispose()
Disposes any captured in-memory data. All allocated resources will be freed.
Declaration
public void Dispose()
Remarks
Any unsaved data is lost.
Reset()
Resets the recording to its initial state and dispose any allocated resources.
Declaration
public void Reset()
Remarks
Resetting this recording allows it to be reused for a new recording session.
Stop()
Stops the current recording session. The captured data remains in memory until it is saved, cleared or disposed.
Declaration
public void Stop()
TryInitialize(XRHandRecordingInitializeArgs)
Initializes a new recording and prepares for capturing hand data, if possible.
Declaration
public bool TryInitialize(XRHandRecordingInitializeArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandRecordingInitializeArgs | args | The initialization arguments XRHandRecordingInitArgs. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
If successful, the recording begins on the subsequent frame update.
Initializing a new recording can fail if a recording is already in progress or the
XRHandSubsystem is null.
It can also fail for other reasons. Refer to the player log
for more detailed information about the cause of a failure.
TrySave(XRHandRecordingSaveArgs)
Attempts to save the captured hand data to disk.
Declaration
public bool TrySave(XRHandRecordingSaveArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandRecordingSaveArgs | args | The save arguments XRHandRecordingSaveArgs. |
Returns
| Type | Description |
|---|---|
| bool | Return |
Remarks
If successful, the in-memory data is disposed to free up resources. Otherwise, the data remains in memory and should be managed accordingly.
Events
frameCaptured
Called when a new frame is captured during a recording.
Declaration
public event Action<XRHandRecordingFrameCapturedEventArgs> frameCaptured
Event Type
| Type | Description |
|---|---|
| Action<XRHandRecordingFrameCapturedEventArgs> |
statusChanged
Called when the status of the recording changes.
Declaration
public event Action<XRHandRecordingStatusChangedEventArgs> statusChanged
Event Type
| Type | Description |
|---|---|
| Action<XRHandRecordingStatusChangedEventArgs> |