Пример #1
0
        private void QrTracker_Added(QRCodeAddedEventArgs args)
        {
            lock (qrCodesList)
            {
                qrCodesList[args.Code.Id] = args.Code;
            }

            Debug.Log("QR Code Added: " + args.Code.Code);
            QRCodeAdded?.Invoke(this, QRCodeEventArgs.Create(args.Code));
        }
Пример #2
0
        private void QrTracker_Removed(QRCodeRemovedEventArgs args)
        {
            lock (qrCodesList)
            {
                qrCodesList.Remove(args.Code.Id);
            }

            Debug.Log("QR Code Lost: " + args.Code.Code);
            QRCodeRemoved?.Invoke(this, QRCodeEventArgs.Create(args.Code));
        }
 private void QRCodeUpdated(object sender, QRCodeEventArgs <QRCodesTrackerPlugin.QRCode> e)
 {
     if (TryGetMarkerId(e.Data.Code, out var markerId))
     {
         lock (_contentLock)
         {
             _markerIds[e.Data.Id]  = markerId;
             _markerSizes[markerId] = e.Data.PhysicalSizeMeters;
             _processMarkers        = true;
         }
     }
 }
Пример #4
0
        private void QrTracker_Updated(QRCodeUpdatedEventArgs args)
        {
            lock (qrCodesList)
            {
                if (!qrCodesList.ContainsKey(args.Code.Id))
                {
                    Debug.LogWarning("QRCode updated that was not previously being observed: " + args.Code.Code);
                }

                qrCodesList[args.Code.Id] = args.Code;
            }

            QRCodeUpdated?.Invoke(this, QRCodeEventArgs.Create(args.Code));
        }
        private void QRCodeRemoved(object sender, QRCodeEventArgs <QRCodesTrackerPlugin.QRCode> e)
        {
            lock (_contentLock)
            {
                if (_markerIds.TryGetValue(e.Data.Id, out var markerId))
                {
                    _markerSizes.Remove(markerId);
                }

                _markerIds.Remove(e.Data.Id);
                _markerCoordinateSystems.Remove(e.Data.Id);
                _processMarkers = true;
            }
        }