From fa3fbcf58eae6e185988c255acc332bf40138ee2 Mon Sep 17 00:00:00 2001 From: gaoduo <1453062510@qq.com> Date: Mon, 13 Apr 2026 14:47:51 +0800 Subject: [PATCH] 1 --- .../Art/Timeline/清理生殖器_TimeLine.playable | 2 +- Assets/SenSorSystem/AudioSensor.cs | 26 ++++++++++ Assets/SenSorSystem/AudioSensor.cs.meta | 11 +++++ Assets/Third/AI/Scripts/Chat/ChatUI.cs | 2 +- Assets/_Scenes/daoNiaoShu.unity | 48 ++++++++++++++++++- .../FSMManager/State/BaChuDaoNiaoGuanState.cs | 3 +- .../FSMManager/State/ChaGuanState.cs | 2 +- 7 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 Assets/SenSorSystem/AudioSensor.cs create mode 100644 Assets/SenSorSystem/AudioSensor.cs.meta diff --git a/Assets/Art/Timeline/清理生殖器_TimeLine.playable b/Assets/Art/Timeline/清理生殖器_TimeLine.playable index 2d72098..6512ea0 100644 --- a/Assets/Art/Timeline/清理生殖器_TimeLine.playable +++ b/Assets/Art/Timeline/清理生殖器_TimeLine.playable @@ -25,7 +25,7 @@ MonoBehaviour: m_Start: 0 m_ClipIn: 0 m_Asset: {fileID: -1020249500316461220} - m_Duration: 4 + m_Duration: 6.033333333333333 m_TimeScale: 1 m_ParentTrack: {fileID: -8792457145005740953} m_EaseInDuration: 0 diff --git a/Assets/SenSorSystem/AudioSensor.cs b/Assets/SenSorSystem/AudioSensor.cs new file mode 100644 index 0000000..e35c157 --- /dev/null +++ b/Assets/SenSorSystem/AudioSensor.cs @@ -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); + } +} diff --git a/Assets/SenSorSystem/AudioSensor.cs.meta b/Assets/SenSorSystem/AudioSensor.cs.meta new file mode 100644 index 0000000..86b995d --- /dev/null +++ b/Assets/SenSorSystem/AudioSensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b80e6b07356243c4299c1d44804c44d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Third/AI/Scripts/Chat/ChatUI.cs b/Assets/Third/AI/Scripts/Chat/ChatUI.cs index 7de3791..d4d0cc6 100644 --- a/Assets/Third/AI/Scripts/Chat/ChatUI.cs +++ b/Assets/Third/AI/Scripts/Chat/ChatUI.cs @@ -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 diff --git a/Assets/_Scenes/daoNiaoShu.unity b/Assets/_Scenes/daoNiaoShu.unity index fc53af2..9033428 100644 --- a/Assets/_Scenes/daoNiaoShu.unity +++ b/Assets/_Scenes/daoNiaoShu.unity @@ -62451,6 +62451,50 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: serializedGuid: 3654304ac7261b4f90f36998fcbab5b4 +--- !u!1 &558201749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 558201750} + - component: {fileID: 558201751} + m_Layer: 0 + m_Name: AudioSensor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &558201750 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 558201749} + 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: 6827219332398779361} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &558201751 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 558201749} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b80e6b07356243c4299c1d44804c44d0, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &558228926 MonoBehaviour: m_ObjectHideFlags: 0 @@ -167498,6 +167542,7 @@ MonoBehaviour: m_EditorClassIdentifier: daoNiaoDeep: 0 txt: {fileID: 439032091} + isOpen: 0 --- !u!114 &1845712798 MonoBehaviour: m_ObjectHideFlags: 0 @@ -215508,7 +215553,7 @@ MonoBehaviour: prefab_v: {fileID: 8158746091421267058} prefab_h_next: {fileID: 5884512289144936276} prefab_v_next: {fileID: 2722395429469450090} - xunFeiWakeup: {fileID: 5420903453684334964} + xunFeiWakeup: {fileID: 612443805} --- !u!114 &2111419097266103041 MonoBehaviour: m_ObjectHideFlags: 0 @@ -330268,6 +330313,7 @@ Transform: - {fileID: 9084052909658758007} - {fileID: 9084052909769445838} - {fileID: 1845712796} + - {fileID: 558201750} m_Father: {fileID: 8343209867889649114} m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/BaChuDaoNiaoGuanState.cs b/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/BaChuDaoNiaoGuanState.cs index be38921..ce6ab55 100644 --- a/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/BaChuDaoNiaoGuanState.cs +++ b/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/BaChuDaoNiaoGuanState.cs @@ -1,5 +1,6 @@ using FSM; using UnityEngine; +using UnityEngine.EventSystems; using ZXKFramework; namespace DongWuYiXue.DaoNiaoShu { @@ -70,7 +71,7 @@ namespace DongWuYiXue.DaoNiaoShu } fsm.nextState = true; } - if (!GameManager.Instance.senSor.GetSensor().isOpen) + if (!GameManager.Instance.senSor.GetSensor().isOpen && isBaGuan) { fsm.StopClip("ι_TimeLine"); } diff --git a/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/ChaGuanState.cs b/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/ChaGuanState.cs index 63e88f7..2d956a1 100644 --- a/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/ChaGuanState.cs +++ b/Assets/_Scripts/Application/daoNiaoShu/FSMManager/State/ChaGuanState.cs @@ -106,7 +106,7 @@ namespace DongWuYiXue.DaoNiaoShu } }); } - if (!GameManager.Instance.senSor.GetSensor().isOpen) + if (!GameManager.Instance.senSor.GetSensor().isOpen && isChaGuan) { fsm.StopClip("_TimeLine"); }