예제 #1
0
        public QRTrackerStartResult StartQRTracking()
        {
            if (qrTracker == null)
            {
                Debug.Log("Creating qr tracker");
                qrTracker          = new QRTracker();
                qrTracker.Added   += QrTracker_Added;
                qrTracker.Updated += QrTracker_Updated;
                qrTracker.Removed += QrTracker_Removed;
            }

            if (!IsTrackerRunning)
            {
                StartResult = (qrTracker.Start());
                if (StartResult == QRTrackerStartResult.Success)
                {
                    IsTrackerRunning = true;
                    QRCodesTrackingStateChanged?.Invoke(this, true);
                }
                else
                {
                    Debug.LogWarning("Failed to start qr tracker: " + StartResult.ToString());
                }
            }

            return(StartResult);
        }
예제 #2
0
 public void StopQRTracking()
 {
     if (IsTrackerRunning)
     {
         IsTrackerRunning = false;
         qrTracker.Stop();
         StartResult = QRTrackerStartResult.DeviceNotConnected;
     }
 }
예제 #3
0
 public QRTrackerStartResult StartQRTracking()
 {
     if (!IsTrackerRunning)
     {
         StartResult = (qrTracker.Start());
         if (StartResult == QRTrackerStartResult.Success)
         {
             IsTrackerRunning = true;
         }
     }
     return(StartResult);
 }
예제 #4
0
        public void StopQRTracking()
        {
            if (IsTrackerRunning)
            {
                IsTrackerRunning = false;
                qrTracker.Stop();
                StartResult = QRTrackerStartResult.DeviceNotConnected;
                QRCodesTrackingStateChanged?.Invoke(this, false);

                lock (qrCodesList)
                {
                    qrCodesList.Clear();
                }
            }
        }