From d0e4d5d8c55a95975fe36e842a2981b5916f5050 Mon Sep 17 00:00:00 2001 From: yangbear Date: Wed, 1 Jul 2026 21:04:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9F=B3=E9=A2=91=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=85=A8=E9=9D=A2=E4=BF=AE=E5=A4=8D=20-=20=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE+PlayHomeBg=E9=87=8D=E5=90=AF+=E9=9F=B3?= =?UTF-8?q?=E6=95=88=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 通过MCP设置所有AudioClip引用到Inspector字段 2. PlayHomeBg去掉clip比较检查,Stop后回来能重新播放 3. basketball/manCall PlayClipAtPoint改用transform.position 4. TouchPositionHandler voiceClip通过SerializedObject赋值 --- Assets/Scripts/Animation/OpeningFlowController.cs | 4 ++-- Assets/Scripts/UI/PageController.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index 87c8c38..7856024 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -127,7 +127,7 @@ public class OpeningFlowController : MonoBehaviour // Step 2: Shoot + 篮球音效 Debug.Log("[OpeningFlow] Step2: Shoot 开始"); - if (_basketballClip != null) AudioSource.PlayClipAtPoint(_basketballClip, Camera.main != null ? Camera.main.transform.position : Vector3.zero); + if (_basketballClip != null) AudioSource.PlayClipAtPoint(_basketballClip, transform.position); if (_manAnimator != null) { _manAnimator.Play("Shoot", 0, 0f); Debug.Log("[OpeningFlow] Shoot Play 已触发"); } yield return new WaitForSeconds(3.15f); Debug.Log("[OpeningFlow] Step2: Shoot 结束"); @@ -136,7 +136,7 @@ public class OpeningFlowController : MonoBehaviour Debug.Log("[OpeningFlow] Step3: manfull 开始"); if (_manAnimator != null) { _manAnimator.Play("manfull", 0, 0f); } yield return new WaitForSeconds(2.1f); - if (_manCallClip != null) AudioSource.PlayClipAtPoint(_manCallClip, Camera.main != null ? Camera.main.transform.position : Vector3.zero); + if (_manCallClip != null) AudioSource.PlayClipAtPoint(_manCallClip, transform.position); Debug.Log("[OpeningFlow] manfull 播放完成, 停留 2s"); yield return new WaitForSeconds(2f); diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index b5358de..297b699 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -146,7 +146,7 @@ public class PageController : MonoBehaviour private void PlayHomeBg() { - if (_homeBgClip != null && _bgAudioSource != null && _bgAudioSource.clip != _homeBgClip) + if (_homeBgClip != null && _bgAudioSource != null) { _bgAudioSource.clip = _homeBgClip; _bgAudioSource.Play();