ソースを参照

红外线测试

lvjincheng 4 年 前
コミット
e8b45b3ad3

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

@@ -216,9 +216,10 @@ public class AimHandler : MonoBehaviour
                 DeviceBatteryView.ins.RenderBattery(1, bytes[0]);
                 return;
             }
-            if (bytes.Length > 3 && bytes[3] == 125)
+            if (bytes.Length >= 3 && bytes[2] == 5)
             {
-                DoIdentity();
+                long time = bytes[8] + (bytes[7] << 8) + (bytes[6] << 16) + (bytes[5] << 24); 
+                Debug.LogWarning("遮挡毫秒:" + time);
             }
             return;
         }

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

@@ -170,6 +170,11 @@ public class BluetoothAim : MonoBehaviour
         }
     }
 
+    // void OpenInfrared() {
+    //     WriteData("1");
+    //     Log("开启红外数据采集\n" + deviceName);
+    // }
+
     void OpenReceiveData()
     {
         WriteData("3");

+ 5 - 0
Assets/BowArrow/Scripts/Bluetooth/BluetoothShoot.cs

@@ -52,6 +52,9 @@ public class BluetoothShoot : MonoBehaviour
         canConnect = true;
         if (ShootCheck.ins) ShootCheck.ins.canAdjustNormalOrHightMode = false;
         SetStatus(BluetoothStatusEnum.ConnectFail);
+        //清除射箭收集的数据
+        dataGetting = false;
+        dataBytes.Clear();
     }
 
     void Update()
@@ -207,6 +210,8 @@ public class BluetoothShoot : MonoBehaviour
         }
     }
 
+    //---收集射箭轴加速度---
+
     bool dataGetting = false;
     int dataGetLen = 0;
     List<byte> dataBytes = new List<byte>();

+ 0 - 6
Assets/BowArrow/Scripts/Manager/LoginMgr.cs

@@ -31,7 +31,6 @@ public class LoginMgr : MonoBehaviour
 
     public static UserInfo myUserInfo = new UserInfo();
     static int userInfo_version = 0;
-    static bool firstComeIn = true;
 
     int loginMode = 1;
 
@@ -56,11 +55,6 @@ public class LoginMgr : MonoBehaviour
         }
     }
 
-    void OnDestroy()
-    {
-        firstComeIn = false;
-    }
-
     InputField GetInputField(GameObject inputNode)
     {
         return inputNode.transform.Find("InputField").GetComponent<InputField>();