Class ARCoreSessionSubsystem
The ARCore implementation of the XRSessionSubsystem. Do not create this directly. Use the SubsystemManager instead.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.ARCore
Assembly: Unity.XR.ARCore.dll
Syntax
[Preserve]
public sealed class ARCoreSessionSubsystem : XRSessionSubsystem, ISubsystem
Properties
playbackStatus
(Read Only) The current playback status.
Declaration
public ArPlaybackStatus playbackStatus { get; }
Property Value
Type | Description |
---|---|
ArPlaybackStatus | Whether or not the session is playing back a recording (or has stopped because of an error). |
recordingStatus
(Read Only) The current recording status.
Declaration
public ArRecordingStatus recordingStatus { get; }
Property Value
Type | Description |
---|---|
ArRecordingStatus | Whether or not the session is recording (or has stopped because of an error). |
session
(Read Only) The ArSession associated with the subsystem. May be null
.
Declaration
public ArSession session { get; }
Property Value
Type | Description |
---|---|
ArSession | The session instance. |
Methods
OnCreate()
Invoked when the subsystem is created.
Declaration
protected override void OnCreate()
Overrides
SetConfigurationDirty()
Initiates a configuration change.
Declaration
public void SetConfigurationDirty()
Remarks
When you call this function, the session dispatches a beforeSetConfiguration event.
StartPlayback(string)
Starts playing back a previously recorded session. (see StartRecording(ArRecordingConfig))
Declaration
public ArStatus StartPlayback(string playbackDataset)
Parameters
Type | Name | Description |
---|---|---|
string | playbackDataset | The path to an mp4 file previously recorded using StartRecording(ArRecordingConfig). |
Returns
Type | Description |
---|---|
ArStatus | Returns Success if successful. Returns one of the following otherwise: - Returns ErrorSessionUnsupported if playback is incompatible with selected features. - Returns ErrorPlaybackFailed if an error occurred with the MP4 dataset file such as not being able to open the file or the file is unable to be decoded. |
Remarks
The begin playback, the session must first be paused, the playback dataset set, then resumed. This method does all of those things for you, but can take significant time (.5 - 1 seconds) to do so.
See Also
StartRecording(ArRecordingConfig)
Starts recording a session.
Declaration
public ArStatus StartRecording(ArRecordingConfig recordingConfig)
Parameters
Type | Name | Description |
---|---|---|
ArRecordingConfig | recordingConfig | The configuration for the recording. |
Returns
Type | Description |
---|---|
ArStatus | Returns Success if recording successfully begins. Returns one of the following otherwise: - ErrorIllegalState - ErrorInvalidArgument - ErrorRecordingFailed |
See Also
StopPlayback()
Stops playing back a session recording.
Declaration
public ArStatus StopPlayback()
Returns
Type | Description |
---|---|
ArStatus | Returns Success if successful. Returns one of the following otherwise: - ErrorSessionUnsupported if playback is incompatible with selected features. - ErrorPlaybackFailed if an error occurred with the MP4 dataset file such as not being able to open the file or the file is unable to be decoded. |
See Also
StopRecording()
Stops recording a session.
Declaration
public ArStatus StopRecording()
Returns
Type | Description |
---|---|
ArStatus | Returns Success if successful. Returns ErrorRecordingFailed otherwise. |
See Also
Events
beforeSetConfiguration
An event that is triggered right before the configuration is set on the session. Allows changes to be made to the configuration before it is set.
Declaration
public event Action<ARCoreBeforeSetConfigurationEventArgs> beforeSetConfiguration
Event Type
Type | Description |
---|---|
Action<ARCoreBeforeSetConfigurationEventArgs> | An Action delegate that provides access to the new session config before it is applied. |