GoogleARCore. ARCoreSession
A component that manages the ARCore Session in a Unity scene.
Summary
Inheritance
Inherits from: MonoBehaviour
Public attributes |
|
---|---|
CameraConfigFilter
|
The camera configuration filter object that defines the set of properties desired or required by the app to run.
|
DeviceCameraDirection = DeviceCameraDirection.BackFacing
|
The direction of the device camera used by the session.
|
SessionConfig
|
A scriptable object specifying the ARCore session configuration.
|
Public functions |
|
---|---|
Awake()
|
virtual void
Unity Awake.
|
OnChooseCameraConfigurationDelegate(List< CameraConfig > supportedConfigurations)
|
delegate int
Selects a camera configuration for the ARCore session being resumed.
|
OnDestroy()
|
virtual void
Unity OnDestroy.
|
OnDisable()
|
void
Unity OnDisable.
|
OnEnable()
|
void
Unity OnEnable.
|
OnValidate()
|
void
Unity OnValidate.
|
RegisterChooseCameraConfigurationCallback(OnChooseCameraConfigurationDelegate onChooseCameraConfiguration)
|
void
Registers a callback that allows a camera configuration to be selected from a list of valid configurations.
|
Public attributes
CameraConfigFilter
ARCoreCameraConfigFilter CameraConfigFilter
The camera configuration filter object that defines the set of properties desired or required by the app to run.
DeviceCameraDirection
DeviceCameraDirection DeviceCameraDirection = DeviceCameraDirection.BackFacing
The direction of the device camera used by the session.
Note that changing this value will trigger a re-initialization of session. ARCore tracking data (e.g. Trackables) are not shared between cameras.
SessionConfig
ARCoreSessionConfig SessionConfig
A scriptable object specifying the ARCore session configuration.
Public functions
Awake
virtual void Awake()
Unity Awake.
OnChooseCameraConfigurationDelegate
delegate int OnChooseCameraConfigurationDelegate( List< CameraConfig > supportedConfigurations )
Selects a camera configuration for the ARCore session being resumed.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The index of the camera configuration in
supportedConfigurations to be used for the ARCore session. If the return value is not a valid index (e.g. the value -1), then no camera configuration will be set and the ARCore session will use the previously selected camera configuration or a default configuration if no previous selection exists. |
OnDestroy
virtual void OnDestroy()
Unity OnDestroy.
OnDisable
void OnDisable()
Unity OnDisable.
OnEnable
void OnEnable()
Unity OnEnable.
OnValidate
void OnValidate()
Unity OnValidate.
RegisterChooseCameraConfigurationCallback
void RegisterChooseCameraConfigurationCallback( OnChooseCameraConfigurationDelegate onChooseCameraConfiguration )
Registers a callback that allows a camera configuration to be selected from a list of valid configurations.
The callback should be registered before the ARCore session is enabled to ensure it is triggered on the first frame update. The callback will then be invoked each time the ARCore session is resumed which can happen when the ARCoreSession component becomes enabled or the Android application moves from 'paused' to 'resumed' state. Note: Starting in ARCore 1.12, changing the active camera config will make existing anchors and trackables fail to regain tracking.
Details | |||
---|---|---|---|
Parameters |
|