浏览代码

修复校准

lvjincheng 3 年之前
父节点
当前提交
dff722933f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

+ 2 - 1
Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

@@ -93,7 +93,8 @@ public class AimHandler : MonoBehaviour
         GyrCalibrater = new o0GyrCalibrater();
         try {
             if (record == null) record = PlayerPrefs.GetString("o0GyrCalibrater");
-            GyrCalibrater = JsonConvert.DeserializeObject<o0GyrCalibrater>(record);
+            var res = JsonConvert.DeserializeObject<o0GyrCalibrater>(record);
+            if (res != null) GyrCalibrater = res;
         } catch(Exception) {}
     }