Ver Fonte

修复校准

lvjincheng há 3 anos atrás
pai
commit
dff722933f
1 ficheiros alterados com 2 adições e 1 exclusões
  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) {}
     }