lvjincheng пре 4 година
родитељ
комит
fa1abdeeb5

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

@@ -218,8 +218,7 @@ public class AimHandler : MonoBehaviour
                     DeviceBatteryView.ins.RenderBattery(1, bytes[0]); //显示电量
                 }
             } else if (bytes[0] == 0x5b) {
-                string info = ShootCheck.ins.ShootByInfrared(bytes); //红外射击检测
-                if (DebugForDevice.ins) DebugForDevice.ins.LogInfrared(info);
+                ShootCheck.ins.ShootByInfrared(bytes); //红外射击检测
             }
             return;
         }

+ 2 - 4
Assets/BowArrow/Scripts/Bluetooth/ShootCheck.cs

@@ -325,7 +325,7 @@ public class ShootCheck : MonoBehaviour
     }
 
     /**通过红外线数据进行射击 */
-    public string ShootByInfrared(byte[] bytes) {
+    public void ShootByInfrared(byte[] bytes) {
         int id = bytes[1]; //序号
         float time1 = bytes[2] * 0.1f; //时区1耗时
         float time2 = bytes[3] * 0.1f; //时区2耗时
@@ -340,7 +340,7 @@ public class ShootCheck : MonoBehaviour
         shootSpeed = Mathf.Sqrt(speed * speed * arrowWeight / LoginMgr.myUserInfo.actualArrowWeight);  
         //打印
         string logTxt = $"序号{id},时长1:{time1}毫秒,时长2:{time2}毫秒,和校验结果:{sumCheckRes},弓轨速度:{speed}m/s,箭的速度:{shootSpeed}m/s";
-        Debug.LogWarning(logTxt);
+        if (DebugForDevice.ins) DebugForDevice.ins.LogInfrared(logTxt);
         //收到射箭数据,就回复硬件,否则n毫秒后硬件会认为丢包进行重传
         try {
             if (sumCheckRes) BluetoothAim.ins.WriteData("I"); //如果数据正确,则回复硬件
@@ -351,8 +351,6 @@ public class ShootCheck : MonoBehaviour
         } catch (Exception) {}
         //调用游戏中的射箭接口
         if (ArmBow.ins) ArmBow.ins.ADS_fire();
-        //返回日志信息
-        return logTxt;
     }
 
     void Dolock()