33 lines
774 B
C#
Raw Normal View History

2025-11-25 17:26:38 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DYKGSensor : Sensor
{
/// <summary>
/// <20><>Դ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
[HideInInspector]
public bool isOpen;
public override void ReceiveData(string datas)
{
base.ReceiveData(datas);
//if (!datas.Split(',')[0].Split(':')[1].Equals(" XWJ")) return;
this.Log(datas);
if (datas.Contains("CONNECTED 1") || !string.IsNullOrEmpty(datas))
{
isOpen = true;
}
if (datas.Contains("DISCONNECTED"))
{
isOpen = false;
}
//isOpen = (!string.IsNullOrEmpty(datas));
}
public override void Display(string datas)
{
//pressText.text = press;
}
}