hi,
关于ImageTarget 组件上面所挂的脚本:
public class EasyImageTargetBehaviour : ImageTargetBehaviour
{
protected override void Awake()
{
base.Awake();
TargetFound += OnTargetFound;
TargetLost += OnTargetLost;
TargetLoad += OnTargetLoad;
TargetUnload += OnTargetUnload;
}
void OnTargetFound(TargetAbstractBehaviour behaviour)
{
Debug.Log("Found: " + Target.Id);
}
void OnTargetLost(TargetAbstractBehaviour behaviour)
{
Debug.Log("Lost: " + Target.Id);
}
void OnTargetLoad(ImageTargetBaseBehaviour behaviour, ImageTrackerBaseBehaviour tracker, bool status)
{
Debug.Log("Load target (" + status + "): " + Target.Id + " (" + Target.Name + ") " + " -> " + tracker);
}
void OnTargetUnload(ImageTargetBaseBehaviour behaviour, ImageTrackerBaseBehaviour tracker, bool status)
{
Debug.Log("Unload target (" + status + "): " + Target.Id + " (" + Target.Name + ") " + " -> " + tracker);
}
}
这几个方法是当识别图找到,丢失,正在加载,不加载时分别实现的,,你可以将你的UI控制的显示放在这几个方法里处理