Class XRControllerRecorder
MonoBehaviour that controls interaction recording and playback (via XRControllerRecording assets).
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("XR/Debug/XR Controller Recorder", 11)]
[DisallowMultipleComponent]
[DefaultExecutionOrder(-30000)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/api/UnityEngine.XR.Interaction.Toolkit.XRControllerRecorder.html")]
public class XRControllerRecorder : MonoBehaviour
Properties
currentTime
(Read Only) The current recording/playback time.
Declaration
public double currentTime { get; }
Property Value
Type | Description |
---|---|
Double |
duration
(Read Only) The total playback time (or 0 if no recording).
Declaration
public double duration { get; }
Property Value
Type | Description |
---|---|
Double |
isPlaying
Whether the XRControllerRecorder is currently playing back interaction state.
Declaration
public bool isPlaying { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
isRecording
Whether the XRControllerRecorder is currently recording interaction state.
Declaration
public bool isRecording { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
playOnStart
Controls whether this recording will start playing when the component's Awake() method is called.
Declaration
public bool playOnStart { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
recording
Controller Recording asset for recording and playback of controller events.
Declaration
public XRControllerRecording recording { get; set; }
Property Value
Type | Description |
---|---|
XRControllerRecording |
recordingStartTime
The time when recording was last started.
Declaration
protected float recordingStartTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
visitEachFrame
If true, every frame of the recording must be visited even if a larger time period has passed.
Declaration
public bool visitEachFrame { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
xrController
The controller that this recording uses for recording and playback.
Declaration
public XRBaseController xrController { get; set; }
Property Value
Type | Description |
---|---|
XRBaseController |
Methods
Awake()
See MonoBehaviour.
Declaration
protected void Awake()
GetControllerState(out XRControllerState)
Gets the state of the controller.
Declaration
public virtual bool GetControllerState(out XRControllerState controllerState)
Parameters
Type | Name | Description |
---|---|---|
XRControllerState | controllerState | When this method returns, contains the XRControllerState object representing the state of the controller. |
Returns
Type | Description |
---|---|
Boolean | Returns true when playing or recording. Otherwise, returns false. |
OnDestroy()
See MonoBehaviour.
Declaration
protected void OnDestroy()
ResetPlayback()
Resets the recorder to the start of the clip.
Declaration
public void ResetPlayback()
Update()
See MonoBehaviour.
Declaration
protected virtual void Update()