1
This commit is contained in:
parent
50192d18f1
commit
9ef66320ae
@ -41,14 +41,14 @@ public class MianQian_SenSor : Sensor
|
||||
|
||||
public override void ReceiveData(string datas, SerialPort sp = null)
|
||||
{
|
||||
base.ReceiveData(datas);
|
||||
if (!datas.Split("OK")[0].Split("ID:")[1].Split(',')[0].Equals("MQ")) return;
|
||||
base.ReceiveData(datas, sp);
|
||||
if (!datas.Split("%")[0].Split("ID:")[1].Split(',')[0].Equals("MQ")) return;
|
||||
//if (!datas.Split("OK")[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ20")) return;
|
||||
//this.Error(datas);
|
||||
lastTime = time;
|
||||
X = float.Parse(datas.Split("OK")[0].Split("PIT:")[1].Split(',')[0]);
|
||||
Y = float.Parse(datas.Split("OK")[0].Split("YAW:")[1].Split(',')[0]);
|
||||
Z = float.Parse(datas.Split("OK")[0].Split("ROL:")[1].Split(',')[0]);
|
||||
X = float.Parse(datas.Split("%")[0].Split("PIT:")[1].Split(',')[0]);
|
||||
Y = float.Parse(datas.Split("%")[0].Split("YAW:")[1].Split(',')[0]);
|
||||
Z = float.Parse(datas.Split("%")[0].Split("ROL:")[1].Split(',')[0]);
|
||||
//this.Error($"当前旋转角度为:{X},{Y},{Z}");
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
using DongWuYiXue.Main;
|
||||
using LitJson;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using DongWuYiXue.Main;
|
||||
|
||||
public class ChatZxkAI : LLM
|
||||
{
|
||||
@ -77,8 +78,10 @@ public class ChatZxkAI : LLM
|
||||
string _msg = currentRequest.downloadHandler.text;
|
||||
Debug.Log(_msg);
|
||||
JsonData responseBody = JsonMapper.ToObject(_msg);
|
||||
Debug.Log(responseBody["choices"][0]["message"]["content"].ToString() + "\nAI-ºÄʱ" + stopwatch.Elapsed.TotalSeconds);
|
||||
assistant = responseBody["choices"][0]["message"]["content"].ToString();
|
||||
//Debug.Log(responseBody["choices"][0]["message"]["content"].ToString() + "\nAI-ºÄʱ" + stopwatch.Elapsed.TotalSeconds);
|
||||
Debug.Log(Regex.Replace(responseBody["choices"][0]["message"]["content"].ToString(), @"\[.*?\]", "") + "\nAI-ºÄʱ" + stopwatch.Elapsed.TotalSeconds);
|
||||
//assistant = responseBody["choices"][0]["message"]["content"].ToString();
|
||||
assistant = Regex.Replace(responseBody["choices"][0]["message"]["content"].ToString(), @"\[.*?\]", "");
|
||||
//»Øµ÷
|
||||
_callback?.Invoke(responseBody["choices"][0]["message"]["content"].ToString());
|
||||
success = true;
|
||||
|
||||
@ -26,17 +26,17 @@ namespace DongWuYiXue.DaoNiaoShu
|
||||
GameManager.Instance.webSockerCameraSender.OnMessageReceived.AddListener(Test);
|
||||
GameManager.Instance.videoUI.SetActive(true);
|
||||
|
||||
cor = Game.Instance.IEnumeratorManager.Run(5.0f, () =>
|
||||
cor = Game.Instance.IEnumeratorManager.Run(2.0f, () =>
|
||||
{
|
||||
isLianJie = true;
|
||||
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||
{
|
||||
fsm.AddScore(2, 0);
|
||||
}
|
||||
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
||||
{
|
||||
fsm.AddScore(2, 0);
|
||||
}
|
||||
//if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
||||
//{
|
||||
// fsm.AddScore(2, 0);
|
||||
//}
|
||||
//if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
||||
//{
|
||||
// fsm.AddScore(2, 0);
|
||||
//}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user