Class XRControllerRecording
The XRControllerRecording ScriptableObject stores position, rotation, and Interaction state changes from the XR Controller for playback.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[CreateAssetMenu(menuName = "XR/XR Controller Recording")]
[Serializable]
[PreferBinarySerialization]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.2/api/UnityEngine.XR.Interaction.Toolkit.XRControllerRecording.html")]
public class XRControllerRecording : ScriptableObject, ISerializationCallbackReceiver
Properties
duration
(Read Only) Total playback time for this recording.
Declaration
public double duration { get; }
Property Value
Type | Description |
---|---|
Double |
frames
(Read Only) Frames stored in this recording.
Declaration
public List<XRControllerState> frames { get; }
Property Value
Type | Description |
---|---|
List<XRControllerState> |
Methods
AddRecordingFrame(Double, Vector3, Quaternion, Boolean, Boolean, Boolean)
(Deprecated) Adds a recording of a frame.
Declaration
[Obsolete("AddRecordingFrame has been deprecated. Use the overload method with the XRControllerState parameter or the method AddRecordingFrameNonAlloc.")]
public void AddRecordingFrame(double time, Vector3 position, Quaternion rotation, bool selectActive, bool activateActive, bool pressActive)
Parameters
Type | Name | Description |
---|---|---|
Double | time | The time for this controller frame. |
Vector3 | position | The position for this controller frame. |
Quaternion | rotation | The rotation for this controller frame. |
Boolean | selectActive | Whether select is active or not. |
Boolean | activateActive | Whether activate is active or not. |
Boolean | pressActive | Whether press is active or not. |
See Also
AddRecordingFrame(XRControllerState)
Adds a recording of a frame.
Duplicates the supplied state
object and adds the copy as a frame recording.
Declaration
public void AddRecordingFrame(XRControllerState state)
Parameters
Type | Name | Description |
---|---|---|
XRControllerState | state | The XRControllerState to be recorded. |
See Also
AddRecordingFrameNonAlloc(XRControllerState)
Adds a recording of a frame.
Adds the supplied state
object as a frame recording; does not allocate new memory.
Declaration
public void AddRecordingFrameNonAlloc(XRControllerState state)
Parameters
Type | Name | Description |
---|---|---|
XRControllerState | state | The XRControllerState to be recorded. |
See Also
InitRecording()
Initializes this recording by clearing all frames stored.
Declaration
public void InitRecording()
SaveRecording()
Saves this recording and writes to disk.
Declaration
public void SaveRecording()
Explicit Interface Implementations
ISerializationCallbackReceiver.OnAfterDeserialize()
See OnAfterDeserialize.
Declaration
void ISerializationCallbackReceiver.OnAfterDeserialize()
Implements
ISerializationCallbackReceiver.OnBeforeSerialize()
See OnBeforeSerialize.
Declaration
void ISerializationCallbackReceiver.OnBeforeSerialize()