CloudRecognizerBaseBehaviour Class

Inherits: DeviceUserAbstractBehaviour


CloudRecognizerBaseBehaviour is the component to control CloudRecognizer in the AR scene.

When it is Bind to a DeviceAbstractBehaviour, it will automatically connect to the server and if the connection fails, an auto reconnection will be triggered.

CloudRecognizer works on its own thread. You can call StartDetect/StopDetect to control the recognition.

Before using a CloudRecognizer, an ImageTracker must be setup and prepared. Any target returned from cloud should be manually put into the ImageTracker if it need to be tracked. Then the target can be used as same as a local target after loaded into the tracker. When a target is recognized, you can get it from CloudUpdate event, and you should use target uid to distinguish different targets. The target id is dynamically created and cannot be used as unique identifier in the cloud condition.

Public Types

enum Status{Success, Reconnecting, Fail}

Public Fields

string Server
string Key
string Secret

Public Functions

bool StartDetect()
bool StopDetect()

Public Events

event Action<CloudRecognizerBaseBehaviour, CloudRecognizer.Status, List<ImageTarget>> CloudUpdate

Overwritten MonoBahaviour Functions

protected virtual void OnDestroy()
protected virtual void Start()
protected virtual void Update()

enum Status






recognition success



connection fail or disconnected, reconnection is ongoing



recognition fail

string Server

Server address, usually has the format of, without http://.

string Key


string Secret


bool StartTrack()

Starts the recognize.

bool StopTrack()

Stops the recognize.

event Action<CloudRecognizerBaseBehaviour, CloudRecognizer.Status, List<ImageTarget>> CloudUpdate

The event when recognition returns a result or connection fail (will auto reconnect).