当Vuforia丢失标记时,附加的3D模型"标记粘在屏幕上。如果标记跟踪丢失,如何使其消失?
答案 0 :(得分:4)
查找您拥有的脚本:
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
OnTrackingFound();
}
else
{
OnTrackingLost();
}
}
然后,实现OnTrackingLost:
void OnTrackingLost()
{
model.SetActive(false);
}