Browse Source

Merge branch 'insertcoin' of https://gitee.com/slambb/smart-bow-infrared into insertcoin

slambb 10 months ago
parent
commit
fc91014d9f

+ 2 - 0
Assets/BowArrow/Scripts/ArrowSerialPort.cs

@@ -70,6 +70,8 @@ public class ArrowSerialPort : MonoBehaviour
             //应用启动 间隔十秒请求一次设备信息
             InvokeRepeating("RequestDeviceIno", 0f, 10f);
             LOG($"{PortName} 串口打开成功!");
+            // 关闭一次摄像头
+            RequestLightState(false);
         }
         else if (msg.Equals("CLOSED"))//串口断开
         {

+ 4 - 1
Assets/BowArrow/Scripts/SerialPortExample.cs

@@ -5,6 +5,8 @@ using System.Collections.Generic;
 using System.IO;
 using Unity.VisualScripting;
 using UnityEngine;
+using UnityEngine.SceneManagement;
+
 public class SerialPortExample : MonoBehaviour
 {
     public int baudrate = 115200;
@@ -334,7 +336,8 @@ public class SerialPortExample : MonoBehaviour
                     if (bytes[3] == 0x01)
                     {
                         Debug.Log("确认按下按键");
-                        AimHandler.ins.ExitIntoEvent();
+                        // AimHandler.ins.ExitIntoEvent();
+                        SceneManager.LoadScene("Home", LoadSceneMode.Single);
                         SendMessage(bytes, 3);
                         return;
                     }