BarCodeScannerBaseBehaviour Class

Inherits: DeviceUserAbstractBehaviour


BarCodeScannerBaseBehaviour is the component for QR code scan.

(until 1.2.1)You can add this component to any object at any time after EasyAR initiallized, and if QR code detected, event BarCodeUpdate will be triggered. A typical usage is like below. You need to keep the object active if you want below function to work.

    private void Start()
        var behaviour = gameObject.AddComponent<BarCodeScannerBehaviour>();
        behaviour.EnableOnStart = true;
        behaviour.BarCodeUpdate += OnBarCodeUpdate;

    private void OnBarCodeUpdate(BarCodeScannerBaseBehaviour scanner, string barcode)
        Debug.Log("barcode: " + barcode);

Public Fields

BarCodeScanner BarCodeScanner
bool EnableOnStart(until 1.2.1)

Public Functions

bool StartScan()
bool StopScan()

Public Events

event Action BarCodeUpdate(until 1.2.1)

Overwritten MonoBahaviour Functions

protected virtual void Awake()(until 1.2.1)
protected virtual void OnDestroy()
protected virtual void Start()
protected virtual void Update() (until 1.2.1)

BarCodeScanner BarCodeScanner

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

bool EnableOnStart

Whether to enable the scan after the AR scene starts (when IAREventHandler.OnARStart is called). If not enabled, you need to manually attach the BarCodeScanner to a CameraDevice and call StartScan.

bool StartScan()

Starts the scan. See BarCodeScanner.Start for more details.

bool StopScan()

Stops the scan. See BarCodeScanner.Stop for more details.

event Action BarCodeUpdate

Event for a barcode update. You can get the barcode string here when a barcode is detected.

results matching ""

    No results matching ""