Ver Fonte

error catch

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