diff --git a/Assets/Scripts/Interaction/TouchPositionHandler.cs b/Assets/Scripts/Interaction/TouchPositionHandler.cs index d238454..18f2899 100644 --- a/Assets/Scripts/Interaction/TouchPositionHandler.cs +++ b/Assets/Scripts/Interaction/TouchPositionHandler.cs @@ -38,7 +38,7 @@ public class TouchPositionHandler : MonoBehaviour womanObject.transform.position = targetPosition.position; womanObject.transform.rotation = targetPosition.rotation; Debug.Log($"[TouchPosition] woman 移动到 {targetPosition.name}"); - if (voiceClip != null) { var asrc = gameObject.AddComponent(); asrc.PlayOneShot(voiceClip); Debug.Log("[TouchPosition] 播放语音: " + voiceClip.name); } } + if (voiceClip != null) { AudioSource.PlayClipAtPoint(voiceClip, transform.position); Debug.Log("[TouchPosition] 播放语音: " + voiceClip.name); // 通知 StepManager 记录步骤 int stepIndex = transform.GetSiblingIndex() + 1; diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index dfa7ba4..b5358de 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -191,8 +191,6 @@ public class PageController : MonoBehaviour var dialogue = GameObject.Find("DialogueBubble"); if (dialogue != null) dialogue.SetActive(false); } - - #endregion #region 按钮回调 @@ -259,7 +257,8 @@ public class PageController : MonoBehaviour Debug.Log($"PageController: GameManager 已设置 Mode=[{gm.CurrentMode}] Fixation=[{gm.CurrentFixationMethod}]"); // 隐藏所有UI面板,准备播放片头动画 - StopBgMusic(); HideAllPages(); + StopBgMusic(); + HideAllPages(); // 找到 OpeningFlowController 播放片头动画 var openingFlow = FindObjectOfType(); @@ -318,23 +317,6 @@ public class PageController : MonoBehaviour if (dialogue != null) dialogue.SetActive(true); } - private System.Collections.IEnumerator PlayWomanAudioSequence() - { - if (_womanClips == null || _womanClips.Length == 0) yield break; - var voiceSource = gameObject.AddComponent(); - voiceSource.loop = false; - voiceSource.playOnAwake = false; - foreach (var clip in _womanClips) - { - if (clip == null) continue; - voiceSource.clip = clip; - voiceSource.Play(); - Debug.Log($"PageController: 播放woman语音: {clip.name}"); - yield return new WaitForSeconds(clip.length + 0.5f); - } - } - - public void ReturnToHome() { Debug.Log("PageController: [ReturnToHome] 返回首页并重置场景"); @@ -364,13 +346,9 @@ public class PageController : MonoBehaviour } #endregion - - [Header("=== 音频 ===")] [SerializeField] private AudioClip _homeBgClip; [SerializeField] private AudioClip _experimentBgClip; [SerializeField] private AudioClip[] _womanClips; private AudioSource _bgAudioSource; - - } diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index f2235c1..5cbd133 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -15,7 +15,7 @@ "com.unity.nuget.newtonsoft-json": "3.0.2", "com.unity.test-framework": "1.1.31" }, - "hash": "85c101f5329ec1b0c6f70cba44614166dd78f53c" + "hash": "11836003a5e2ffcb7715ecec7e1fbb9d9cdb5bb8" }, "com.unity.burst": { "version": "1.8.21",