private void UpdateTexture() { if (!NRRgbCamera.HasFrame()) { return; } RGBRawDataFrame rgbRawDataFrame = NRRgbCamera.GetRGBFrame(); m_texture.LoadRawTextureData(rgbRawDataFrame.data); m_texture.Apply(); CurrentFrame.timeStamp = rgbRawDataFrame.timeStamp; CurrentFrame.texture = m_texture; FrameCount++; OnUpdate?.Invoke(CurrentFrame); }
private void UpdateTexture() { if (!NRRgbCamera.HasFrame()) { return; } RGBRawDataFrame rgbRawDataFrame = NRRgbCamera.GetRGBFrame(); if (m_texture == null || m_texture.width != NRRgbCamera.Resolution.width || m_texture.height != NRRgbCamera.Resolution.height) { m_texture = new Texture2D(NRRgbCamera.Resolution.width, NRRgbCamera.Resolution.height, TextureFormat.RGB24, false); } m_texture.LoadRawTextureData(rgbRawDataFrame.data); m_texture.Apply(); CurrentFrame.timeStamp = rgbRawDataFrame.timeStamp; CurrentFrame.texture = m_texture; if (OnUpdate != null) { OnUpdate(CurrentFrame); } }