Browse Source

修复校准

lvjincheng 3 năm trước cách đây
mục cha
commit
dff722933f
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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) {}
     }