CameraDeviceBaseBehaviour Class


CameraDeviceBaseBehaviour is the component to control CameraDevice in the AR scene.

It contains the entrance of AR chain, OpenAndStart.

Below code shows how to dynamically switch to Front camera when the Back camera is being used and the track is running.

    ARBuilder.Instance.CameraDeviceBehaviours[0].CameraDeviceType = CameraDevice.Device.Front;

Public Properties

boolHorizontalFlip (since 1.3.0)

Public Fields


Public Functions


Public Events

event Action<CameraDeviceBaseBehaviour, bool>DeviceStart

Overwritten MonoBahaviour Functions

protected virtual voidOnDestroy()
protected virtual voidStart()

CameraDevice.Device CameraDeviceType

Device type to open. It must be set before OpenAndStart.

float CameraFPS

Camera fps. The set must be called before OpenAndStart.

Vector2 CameraSize

Camera size. The set must be called before OpenAndStart.

bool HorizontalFlip (since 1.3.0)

The horizontal flip flag. When set, the camera image will be horizontal flipped from default.

bool CaptureWhenStart

Whether to open device and start capture at the MonoBehaviour.Start. If false, you must call OpenAndStart to bootup the AR chain.

CameraDevice Device

The CameraDevice object. You can reach advanced controls with Device. See CameraDevice for more details.

void Close()

Closes the camera and the whole connected AR chain will stop. You can change bindings using bind calls and camera devices using CameraDeviceType. Call OpenAndStart to restart.

void OpenAndStart()

Open the device of type CameraDeviceType and start capture immediately. See CameraDevice.Open and CameraDevice.Start for more details.

This is start point of the AR scene. All connections (all bind calls) except ImageTargetBaseBehaviour.Bind must be done before calling this function. It will use the connections established in the bind calls to bootup the whole AR scene.

bool StartCapture()

Starts the capture. See CameraDevice.Start for more details.

bool StopCapture()

Stops the capture. All connections and configurations are kept unchanged. See CameraDevice.Stop for more details.

event Action<CameraDeviceBaseBehaviour, bool> DeviceStart

The event for after OpenAndStart called.