feat: 开场音频系统 - 篮球音效+manCall

- OpeningFlowController新增_basketballClip/_manCallClip SerializeField
- Step2 Shoot开始时播放篮球音效
- Step3 manfull摔倒后播放manCall
- AudioSource.PlayClipAtPoint播放
This commit is contained in:
yangbear
2026-06-30 23:40:37 +08:00
parent 9ce2bccbeb
commit 89037cb9dc
17 changed files with 166 additions and 20 deletions
@@ -119,40 +119,27 @@ public class OpeningFlowController : MonoBehaviour
{
Debug.Log("=== [OpeningFlow] 片头动画流程开始 ===");
// 重置 + 等一帧让 Animator 处理
if (_manAnimator != null)
{
_manAnimator.SetBool("IsStart", false);
_manAnimator.SetBool("IsFull", false);
}
if (_manAnimator != null) { _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); }
yield return null;
// Step 1: Idle 1s
Debug.Log("[OpeningFlow] Step1: man + man2 Idle (1s)");
yield return new WaitForSeconds(1f);
// Step 2: Shoot 3.15s —— 直接 Play,不走 Animator 过渡
// Step 2: Shoot + 篮球音效
Debug.Log("[OpeningFlow] Step2: Shoot 开始");
if (_manAnimator != null)
{
_manAnimator.Play("Shoot", 0, 0f);
Debug.Log("[OpeningFlow] Shoot Play 已触发");
}
if (_basketballClip != null) AudioSource.PlayClipAtPoint(_basketballClip, Camera.main != null ? Camera.main.transform.position : Vector3.zero);
if (_manAnimator != null) { _manAnimator.Play("Shoot", 0, 0f); Debug.Log("[OpeningFlow] Shoot Play 已触发"); }
yield return new WaitForSeconds(3.15f);
Debug.Log("[OpeningFlow] Step2: Shoot 结束");
// Step 3: 摔倒 manfull 2.1s + 停留 2s
// Step 3: 摔倒 + manCall 音效
Debug.Log("[OpeningFlow] Step3: manfull 开始");
if (_manAnimator != null)
{
_manAnimator.Play("manfull", 0, 0f);
Debug.Log("[OpeningFlow] manfull Play 已触发");
}
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);
Debug.Log("[OpeningFlow] manfull 播放完成, 停留 2s");
yield return new WaitForSeconds(2f);
// Step 4: 黑幕
Debug.Log("[OpeningFlow] Step4: 黑幕");
yield return StartCoroutine(FadeBlackScreen(0f, 1f));
@@ -206,4 +193,9 @@ public class OpeningFlowController : MonoBehaviour
[Header("=== 开关 ===")]
[SerializeField] private bool _enableOpeningFlow = true;
[Header("=== 音效 ===")]
[SerializeField] private AudioClip _basketballClip;
[SerializeField] private AudioClip _manCallClip;
}