From c88651be549aa12211cb29e51a9461060b37ae22 Mon Sep 17 00:00:00 2001 From: yangbear Date: Tue, 30 Jun 2026 00:58:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Shoot=E4=B9=9F=E6=94=B9=E7=94=A8Play?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=92=AD=E6=94=BE=EF=BC=8C=E5=BD=BB=E5=BA=95?= =?UTF-8?q?=E7=BB=95=E8=BF=87Animator=20Controller=E8=BF=87=E6=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Shoot和manfull都使用_manAnimator.Play()直接播放 - 开头加yield return null让Animator处理重置 - 不再依赖SetBool参数过渡,消除所有Animator Controller不确定性 --- .../Animation/OpeningFlowController.cs | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index 113bb08..a88c638 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -94,34 +94,30 @@ public class OpeningFlowController : MonoBehaviour { Debug.Log("=== [OpeningFlow] 片头动画流程开始 ==="); - // 重置参数,默认 Idle + // 重置 + 等一帧让 Animator 处理 if (_manAnimator != null) { _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); - Debug.Log("[OpeningFlow] man Animator 已重置, 默认 Idle"); } + 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 - Debug.Log("[OpeningFlow] Step2: man Shoot 开始 (3.15s)"); + // Step 2: Shoot 3.15s —— 直接 Play,不走 Animator 过渡 + Debug.Log("[OpeningFlow] Step2: Shoot 开始"); if (_manAnimator != null) { - _manAnimator.SetBool("IsStart", true); - Debug.Log("[OpeningFlow] man IsStart=true, 等待 Shoot 播完"); + _manAnimator.Play("Shoot", 0, 0f); + Debug.Log("[OpeningFlow] Shoot Play 已触发"); } yield return new WaitForSeconds(3.15f); - if (_manAnimator != null) - { - _manAnimator.SetBool("IsStart", false); - Debug.Log("[OpeningFlow] Step2: Shoot 结束"); - } + Debug.Log("[OpeningFlow] Step2: Shoot 结束"); - // Step 3: 摔倒 manfull —— 直接 Play 不走过渡 - Debug.Log("[OpeningFlow] Step3: manfall 开始"); + // Step 3: 摔倒 manfull 2.1s + 停留 2s + Debug.Log("[OpeningFlow] Step3: manfull 开始"); if (_manAnimator != null) { _manAnimator.Play("manfull", 0, 0f); @@ -131,8 +127,8 @@ public class OpeningFlowController : MonoBehaviour Debug.Log("[OpeningFlow] manfull 播放完成, 停留 2s"); yield return new WaitForSeconds(2f); - // Step 4: 黑幕转场 - Debug.Log("[OpeningFlow] Step4: 黑幕转场开始"); + // Step 4: 黑幕 + Debug.Log("[OpeningFlow] Step4: 黑幕"); yield return StartCoroutine(FadeBlackScreen(0f, 1f)); if (_manAnimator != null) { _manAnimator.gameObject.SetActive(false); Debug.Log("[OpeningFlow] man 已隐藏"); } @@ -141,7 +137,6 @@ public class OpeningFlowController : MonoBehaviour if (_manInjuryObject != null) { _manInjuryObject.SetActive(true); Debug.Log("[OpeningFlow] manInjury 已显示"); } SwitchToCamera2(); - yield return new WaitForSeconds(0.3f); yield return StartCoroutine(FadeBlackScreen(1f, 0f));