31 lines
714 B
C#

using System.Collections;
using System.Collections.Generic;
using System.IO.Ports;
using System.Text;
using UnityEngine;
public class AudioSensor : Sensor
{
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
}
public override void ReceiveData(string datas, SerialPort sp = null)
{
base.ReceiveData(datas, sp);
this.Log(datas);
if (datas.Contains("hello"))
{
ChatUI.Instance.xunFeiWakeup.callBack?.Invoke();
}
//if (datas.ToString().TrimEnd('\n', '\r') == "hello")
//{
//}
}
public override void Display(string datas)
{
base.Display(datas);
}
}