Ejemplo n.º 1
0
    void Update()
    {
        if (_Reader != null)
        {
            var frame = _Reader.AcquireLatestFrame();
            if (frame != null)
            {
                if (_Data == null)
                {
                    _Data = new Body[_Sensor.BodyFrameSource.BodyCount];
                }

                _trackingId = 0;
                frame.GetAndRefreshBodyData(_Data);

                frame.Dispose();
                frame = null;

                foreach (var body in _Data)
                {
                    if (body != null && body.IsTracked)
                    {
                        _trackingId = body.TrackingId;
                        if (GestureManager != null)
                        {
                            GestureManager.SetTrackingId(body.TrackingId);
                        }
                        break;
                    }
                }
            }
        }
    }