public void Update() { if (socket != null && socket.IsConnected() && socket.FrameRequested && latestCameraData != null) { socket.Send(latestCameraData); latestCameraData = null; socket.FrameRequested = false; logger.LogFrameSent(socket.CarInfo); } }
void OnCompleteReadback(AsyncGPUReadbackRequest request) { hasRequest = false; if (request.hasError) { Debug.Log("GPU readback error detected."); return; } if (virtualPhoto == null || socket == null) { return; } virtualPhoto.LoadRawTextureData(outputArray); virtualPhoto.Apply(); socket.Send(encodeFrame(virtualPhoto)); }