TrackerBaseBehaviour Class (until 1.2.1)

Description

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

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

Public Fields

ImageTracker Tracker

Public Properties

List<ImageTargetBaseBehaviour> LoadedTargetBehaviours

Public Functions

void Bind(AugmenterBaseBehaviour behaviour)
void UnBind(AugmenterBaseBehaviour behaviour)
void Bind(CameraDeviceBaseBehaviour behaviour)
void UnBind(CameraDeviceBaseBehaviour behaviour)
void LoadImageTargetBehaviour(ImageTargetBaseBehaviour imageTargetBaseBehaviour)
void UnloadImageTargetBehaviour(ImageTargetBaseBehaviour imageTargetBaseBehaviour)
void RegisterAREventHandler(IAREventHandler handler)
void UnregisterAREventHandler(IAREventHandler handler)
void RegisterTargetEventHandler(ITargetEventHandler targetEventHandler)
void UnregisterTargetEventHandler(ITargetEventHandler targetEventHandler)
bool StartTrack()
bool StopTrack()

Public Events

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

Overwritten MonoBahaviour Functions

protected virtual void OnApplicationPause(bool pause)
protected virtual void OnApplicationQuit()
protected virtual void OnDestroy()
protected virtual void Start()
protected virtual void Update()

ImageTracker Tracker

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

List<ImageTargetBaseBehaviour> LoadedTargetBehaviours

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

void Bind(AugmenterBaseBehaviour behaviour)

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

void UnBind(AugmenterBaseBehaviour behaviour)

Unbind AugmenterBaseBehaviour。

void Bind(CameraDeviceBaseBehaviour behaviour)

Binds CameraDeviceBaseBehaviour。这个方法在构建AR场景的过程中使用。在AR功能可以工作之前,TrackerB aseBehaviour必须被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的时候触发。