最新修改提交

This commit is contained in:
高铎 2026-04-13 16:48:29 +08:00
parent 7062897d2c
commit e65d0d62f9
26 changed files with 136 additions and 30 deletions

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using System.IO.Ports;
using System.Text;
using UnityEngine;
public class AudioSensor : Sensor
{
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);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 553a688457542a547a510f906a5a4eb5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -32,7 +32,7 @@ public class ZhuSheQi_10SenSor : Sensor
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ10")) return;
//this.Error(datas);
lastTime = time;
progressValue = (Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1])) / 10.0f;
progressValue = (float)double.Parse(datas.Split("%")[0].Split("LEVEL:")[1]) / 10.0f;
//this.Error($"当前10ml注射器的进度为{progressValue}");
}
float time;

View File

@ -20,6 +20,11 @@ public class ZhuSheQi_5SenSor : Sensor
[SerializeField]
Text txt;
[HideInInspector]
public bool isOpen;
float time;
float lastTime;
private void Start()
{
transform.parent.GetComponent<SensorManager>().SendFunction("+++");
@ -30,12 +35,25 @@ public class ZhuSheQi_5SenSor : Sensor
base.ReceiveData(datas);
if (!datas.Split('%')[0].Split("ID:")[1].Split(',')[0].Equals("ZSQ5")) return;
//this.Error(datas);
lastTime = time;
//progressValue = ((Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1]))-3) / 7.0f;
progressValue = ((Convert.ToInt32(datas.Split("%")[0].Split("LEVEL:")[1]))-3) / 6.0f;
progressValue = (float)double.Parse(datas.Split("%")[0].Split("LEVEL:")[1]) / 10.0f;
//this.Error($"µ±Ç°5ml×¢ÉäÆ÷µÄ½ø¶ÈΪ£º{progressValue}");
}
private void Update()
{
time += Time.deltaTime;
if (time - lastTime < 1.0f)
{
isOpen = true;
}
else
{
isOpen = false;
//progressValue = 0;
}
txt.text = $"10ml×¢ÉäÆ÷¿ªÆô:{isOpen}À­È¡½ø¶È:{progressValue}";
}
public override void Display(string datas)
{
base.Display(datas);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cec1aec18fafc544db9c9d8fb70f1f0e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@ public class ChatUI : MonoBehaviour
private float wakeUpCountdownTime = 5f;
private float wakeUpCurrentTime;
private Coroutine coroutine;
public XunFeiWakeup xunFeiWakeup;//语音唤醒
public ZXKWakeup xunFeiWakeup;//语音唤醒
private bool chatUIOpen;
private string speakTxt;
public string SpeakTxt

View File

@ -19802,6 +19802,11 @@ PrefabInstance:
propertyPath: m_Layer
value: 8
objectReference: {fileID: 0}
- target: {fileID: 7604503801446381201, guid: 7aed8de88ca84a84ea99f939edf39e8a,
type: 3}
propertyPath: xunFeiWakeup
value:
objectReference: {fileID: 1205967528}
- target: {fileID: 7674398523607859925, guid: 7aed8de88ca84a84ea99f939edf39e8a,
type: 3}
propertyPath: m_Layer
@ -59100,6 +59105,37 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
serializedGuid: a5f498921091ac4d90f33b26fb48724b
--- !u!1 &955148642
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 955148643}
m_Layer: 8
m_Name: AudioSensor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &955148643
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 955148642}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1144569946378387086}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &955184125
MonoBehaviour:
m_ObjectHideFlags: 0
@ -112408,7 +112444,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 48dd5e49debeead44a7105f01b94cfd5, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultStateName: ShuZheZhunBeiState
defaultStateName: BingLiXinXiState
nextState: 0
--- !u!4 &44452961559943390
Transform:
@ -118465,6 +118501,7 @@ Transform:
- {fileID: 34381057}
- {fileID: 1841473862}
- {fileID: 1660633280}
- {fileID: 955148643}
m_Father: {fileID: 44452962039568050}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -142362,7 +142399,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u5927\u578B\u72AC\u6C14\u7BA1\u63D2\u7BA1\u865A\u62DF\u4EFF\u771F\u8BAD\u7EC3\u7CFB\u7EDF"
m_Text: "\u5927\u578B\u72AC\u6C14\u7BA1\u63D2\u7BA1\u865A\u5B9E\u7ED3\u5408\u8BAD\u7EC3\u7CFB\u7EDF"
--- !u!224 &5087122795205665623
RectTransform:
m_ObjectHideFlags: 0

View File

@ -17,10 +17,10 @@ namespace DongWuYiXue.QiGuanChaGuan
fsm.ShowCamera("²åÈëÆø¹Üµ¼¹Ü_Camera");
fsm.ShowTip(1);
fsm.PlayBgm(1);
//cor = Game.Instance.IEnumeratorManager.Run(3.0f, () =>
//{
isChaRu = true;
//});
cor = Game.Instance.IEnumeratorManager.Run(2.0f, () =>
{
isChaRu = true;
});
}
public override void OnStateStay()
{

View File

@ -37,7 +37,10 @@ namespace DongWuYiXue.QiGuanChaGuan
base.OnStateStay();
if (isLa)
{
laValue = GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().progressValue;
if (GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().isOpen)
{
laValue = GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().progressValue;
}
fsm.PlayClip("³äӯθÄÒÀ­_TimeLine", null, laValue);
if (Input.GetKeyDown(KeyCode.L))
{
@ -66,7 +69,10 @@ namespace DongWuYiXue.QiGuanChaGuan
}
if (isTui)
{
tuiValue = 1 - GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().progressValue;
if (GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().isOpen)
{
tuiValue = 1 - GameManager.Instance.senSor.GetSensor<ZhuSheQi_5SenSor>().progressValue;
}
fsm.PlayClip("³äӯθÄÒÍÆ_TimeLine", null, tuiValue);
if (Input.GetKeyDown(KeyCode.L))
{

View File

@ -823,7 +823,7 @@ PlayerSettings:
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: com.unity.template-starter-kit
metroPackageVersion:
metroPackageVersion: 1.0.0.0
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
@ -831,7 +831,7 @@ PlayerSettings:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: com.unity.template-starter-kit
wsaImages: {}
metroTileShortName:
metroTileShortName: QiGuanChaGuan_Dog
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0