|
|
@@ -163,7 +163,7 @@ public class ArrowSerialPort : MonoBehaviour
|
|
|
bool lightWaitClose = false;
|
|
|
public void DelayCloseLight()
|
|
|
{
|
|
|
- if (!lightWaitClose)
|
|
|
+ if (!lightWaitClose && hasOnceInceCoin)
|
|
|
{
|
|
|
LOG("游戏时间结束 延迟关闭激光");
|
|
|
Invoke("DoDelayCloseLight", 60f);
|
|
|
@@ -183,13 +183,17 @@ public class ArrowSerialPort : MonoBehaviour
|
|
|
RequestLightState(false);
|
|
|
}
|
|
|
|
|
|
+ //是否有过首次投币 没投币过 不关闭摄像头
|
|
|
+ bool hasOnceInceCoin = false;
|
|
|
#region APP请求
|
|
|
// 异或校验内容:命令+长度+数据内容
|
|
|
/// <summary>
|
|
|
/// 设置激光状态
|
|
|
/// </summary>
|
|
|
- public void RequestLightState(bool on)
|
|
|
+ public void RequestLightState(bool on, bool insertCoin = false)
|
|
|
{
|
|
|
+ if (insertCoin)
|
|
|
+ hasOnceInceCoin = true;
|
|
|
List<byte> data = new List<byte>();
|
|
|
data.Add(0xAA);//起始码
|
|
|
data.Add(0x83);//命令号
|