Explorar o código

恢复PlayerPrefs保存地磁计校准数据

lvjincheng %!s(int64=4) %!d(string=hai) anos
pai
achega
0fdcc4fc0d
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

+ 9 - 0
Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

@@ -229,6 +229,15 @@ class AimHandler
                     MagCalibrater.Calibration = false;
                     Debug.Log(MagCalibrater.Calibration);
                     MagCalibrationButton.GetComponentInChildren<Text>().text = "开始地磁计校准";
+                    float[] dataFloats = new float[6];
+                    dataFloats[0] = MagCalibrater.Center.x;
+                    dataFloats[1] = MagCalibrater.Center.y;
+                    dataFloats[2] = MagCalibrater.Center.z;
+                    dataFloats[3] = MagCalibrater.Radius.x;
+                    dataFloats[4] = MagCalibrater.Radius.y;
+                    dataFloats[5] = MagCalibrater.Radius.z;
+                    string dataStr = String.Join(",", dataFloats);
+                    PlayerPrefs.SetString("o0MagneticCalibrater", dataStr);
                 }
                 else
                 {