private void OnHeadsetCalibrationUpdated(byte[] data) { if (HeadsetCalibrationData.TryDeserialize(data, out var headsetCalibrationData)) { this.headsetData = headsetCalibrationData; } }
private void OnCalibrationDataReceived(SocketEndpoint endpoint, string command, BinaryReader reader, int remainingDataSize) { Debug.Log("Received calibration data payload."); HeadsetCalibrationData headsetCalibrationData; if (HeadsetCalibrationData.TryDeserialize(reader, out headsetCalibrationData)) { headsetData = headsetCalibrationData; } }
private void OnDataReceived(string playerId, byte[] payload) { Debug.Log($"Received payload of {payload.Length} bytes"); HeadsetCalibrationData headsetCalibrationData; if (HeadsetCalibrationData.TryDeserialize(payload, out headsetCalibrationData)) { headsetData = headsetCalibrationData; } }
public static HeadsetCalibrationData LoadHeadsetData(string filename) { string path = Path.Combine(GetDocumentsFolderPath(), RootDirectoryName, HeadsetDataDirectory, $"{filename}.json"); if (File.Exists(path)) { var fileData = File.ReadAllBytes(path); if (HeadsetCalibrationData.TryDeserialize(fileData, out var calibrationData)) { return(calibrationData); } } return(null); }