TrackerBaseBehaviour Class

Description

TrackerBaseBehaviour (until 1.2.1)是在AR场景中控制ImageTracker的component。

ImageTargetBaseBehaviour必须先被加载到TrackerBaseBehaviour中它内部的target才能被跟踪。

Public Fields

ImageTrackerTracker

Public Properties

List<ImageTargetBaseBehaviour>LoadedTargetBehaviours

Public Functions

voidBind(AugmenterBaseBehaviour behaviour)
voidUnBind(AugmenterBaseBehaviour behaviour)
voidBind(CameraDeviceBaseBehaviour behaviour)
voidUnBind(CameraDeviceBaseBehaviour behaviour)
voidLoadImageTargetBehaviour(ImageTargetBaseBehaviour imageTargetBaseBehaviour)
voidUnloadImageTargetBehaviour(ImageTargetBaseBehaviour imageTargetBaseBehaviour)
voidRegisterAREventHandler(IAREventHandler handler)
voidUnregisterAREventHandler(IAREventHandler handler)
voidRegisterTargetEventHandler(ITargetEventHandler targetEventHandler)
voidUnregisterTargetEventHandler(ITargetEventHandler targetEventHandler)
boolStartTrack()
boolStopTrack()

Public Events

event Action<TrackerBaseBehaviour, CameraDeviceBaseBehaviour>ARStart
event Action<TrackerBaseBehaviour>ARStop

Overwritten MonoBahaviour Functions

protected virtual voidOnApplicationPause(bool pause)
protected virtual voidOnApplicationQuit()
protected virtual voidOnDestroy()
protected virtual voidStart()
protected virtual voidUpdate()

ImageTracker Tracker

ImageTracker物体。你可以通过Tracker获得更加高级的控制。详见ImageTracker

List<ImageTargetBaseBehaviour> LoadedTargetBehaviours

当前加载进这个component的所有ImageTargetBaseBehaviour。

void Bind(AugmenterBaseBehaviour behaviour)

Binds AugmenterBaseBehaviour。这个方法在构建AR场景的过程中使用。在AR功能可以工作之前,TrackerBaseBehaviour必须被bind到AugmenterBaseBehaviour上面。

void UnBind(AugmenterBaseBehaviour behaviour)

Unbind AugmenterBaseBehaviour。

void Bind(CameraDeviceBaseBehaviour behaviour)

Binds CameraDeviceBaseBehaviour。这个方法在构建AR场景的过程中使用。在AR功能可以工作之前,TrackerBaseBehaviour必须被bind到CameraDeviceBaseBehaviour上面。

void UnBind(CameraDeviceBaseBehaviour behaviour)

Unbind CameraDeviceBaseBehaviour。

void LoadImageTargetBehaviour(ImageTargetBaseBehaviour imageTargetBaseBehaviour)

将ImageTargetBaseBehaviour以及它内部的target加载进这个component。这个方法和ImageTargetBaseBehaviour.LoadIntoTrackerBehaviour是相同的。

void UnloadImageTargetBehaviour(ImageTargetBaseBehaviour imageTargetBaseBehaviour)

从这个component中卸载ImageTargetBaseBehaviour和它的target。

void RegisterAREventHandler(IAREventHandler handler)

注册IAREventHandler。详见IAREventHandler

void UnregisterAREventHandler(IAREventHandler handler)

反注册IAREventHandler。

void RegisterTargetEventHandler(ITargetEventHandler targetEventHandler)

注册ITargetEventHandler。详见ITargetEventHandler

实现了ITargetEventHandler接口的ImageTargetBaseBehaviour不需要调用这个注册接口,它将会被自动注册。

void UnregisterTargetEventHandler(ITargetEventHandler targetEventHandler)

反注册ITargetEventHandler。

bool StartTrack()

开始跟踪。详见ImageTracker.Start

bool StopTrack()

停止跟踪。详见ImageTracker.Stop

event Action<TrackerBaseBehaviour, CameraDeviceBaseBehaviour> ARStart

AR开始事件。在成功启动整个AR链的时候或在成功启动之后注册IAREventHandler的时候触发。

event Action<TrackerBaseBehaviour> ARStop

AR停止事件。在这个component销毁或反注册IAREventHandler的时候触发。