Vuforia:当标记丢失时,图像会粘在屏幕上

时间:2017-10-26 01:23:55

标签: c# unity3d augmented-reality vuforia

当Vuforia丢失标记时,附加的3D模型"标记粘在屏幕上。如果标记跟踪丢失,如何使其消失?

1 个答案:

答案 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);
}