|
@@ -90,20 +90,22 @@ public class AimHandler : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void InitGyr(string record) {
|
|
public void InitGyr(string record) {
|
|
|
- GyrCalibrater = new o0GyrCalibrater();
|
|
|
|
|
try {
|
|
try {
|
|
|
if (!string.IsNullOrEmpty(record)) {
|
|
if (!string.IsNullOrEmpty(record)) {
|
|
|
var res = JsonConvert.DeserializeObject<o0GyrCalibrater>(record);
|
|
var res = JsonConvert.DeserializeObject<o0GyrCalibrater>(record);
|
|
|
if (res != null) GyrCalibrater = res;
|
|
if (res != null) GyrCalibrater = res;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ GyrCalibrater = new o0GyrCalibrater();
|
|
|
}
|
|
}
|
|
|
} catch(Exception) {}
|
|
} catch(Exception) {}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void InitMag(string record) {
|
|
public void InitMag(string record) {
|
|
|
- MagCalibrater = new MagnetometerAutoCalibrater();
|
|
|
|
|
try {
|
|
try {
|
|
|
if (!string.IsNullOrEmpty(record)) {
|
|
if (!string.IsNullOrEmpty(record)) {
|
|
|
MagCalibrater = MagJsonConvert.Parse(record);
|
|
MagCalibrater = MagJsonConvert.Parse(record);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ MagCalibrater = new MagnetometerAutoCalibrater();
|
|
|
}
|
|
}
|
|
|
} catch (System.Exception e) {
|
|
} catch (System.Exception e) {
|
|
|
Debug.LogError("地磁计反序列化出错");
|
|
Debug.LogError("地磁计反序列化出错");
|