33 lines
774 B
C#
33 lines
774 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DYKGSensor : Sensor
|
|
{
|
|
/// <summary>
|
|
/// µçÔ´ÊÇ·ñ¿ªÆô
|
|
/// </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;
|
|
}
|
|
}
|