lvjincheng před 3 roky
rodič
revize
dff722933f
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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) {}
     }