コード例 #1
0
    public void OnTrackableStateChanged(
        TestTrackableBehaviour.Status previousStatus,
        TestTrackableBehaviour.Status newStatus)
    {
        m_PreviousStatus = previousStatus;
        m_NewStatus      = newStatus;

        Debug.Log("Trackable " + mTrackableBehaviour.TrackableName +
                  " " + mTrackableBehaviour.CurrentStatus);

        if (newStatus == TestTrackableBehaviour.Status.DETECTED ||
            newStatus == TestTrackableBehaviour.Status.TRACKED ||
            newStatus == TestTrackableBehaviour.Status.EXTENDED_TRACKED)
        {
            OnTrackingFound();
        }
        else if ((previousStatus == TestTrackableBehaviour.Status.TRACKED || previousStatus == TestTrackableBehaviour.Status.EXTENDED_TRACKED) &&
                 newStatus == TestTrackableBehaviour.Status.NO_POSE)
        {
            OnTrackingLost();
        }
        else
        {
            OnTrackingLost();
        }
    }
コード例 #2
0
 public virtual void OnTrackerUpdate(TestTrackableBehaviour.Status newStatus)
 {
     TestTrackableBehaviour.Status mStatus = this.mStatus;
     this.mStatus = newStatus;
     if (mStatus != newStatus)
     {
         foreach (ITestTrackableEventHandler trackableEventHandler in this.mTrackableEventHandlers)
         {
             trackableEventHandler.OnTrackableStateChanged(mStatus, newStatus);
         }
     }
 }