void Update() { if (kinectInitialized) { colorStreamUpdated = KinectV2Wrapper.PollColor(colorFrameReader, ref processedKinectData.ColorStreamData); infraredStreamUpdated = KinectV2Wrapper.PollInfrared(infraredFrameReader, ref processedKinectData.RawDepths); depthDataUpdated = KinectV2Wrapper.PollDepth(depthFrameReader, KinectV2Wrapper.Constants.IsNearMode, ref processedKinectData.CorrectedDepths); if (colorStreamUpdated && depthDataUpdated && (displayStreams || displayPointCloud)) { RefreshStreamsAndPointCloud(); } if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } } }