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

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

@@ -379,7 +379,10 @@ public class AimHandler : MonoBehaviour
            
         // }
         mag0o = UnityVectorTo0o(Mag);
-        if (!MagCalibrater.Update(mag0o)) {
+        try {
+            if (!MagCalibrater.Update(mag0o)) return;
+        } catch(System.Exception) {
+            MagCalibrater = new MagnetometerAutoCalibrater();
             return;
         }
         mag0o = MagCalibrater.EllipsoidFitting.Map(mag0o);