From c38016ce26c794f24fb52a25f1861bfa65fb0b1c Mon Sep 17 00:00:00 2001 From: yangbear Date: Mon, 29 Jun 2026 20:54:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Shoot=E6=9C=9F=E9=97=B4=E6=AF=8F?= =?UTF-8?q?=E5=B8=A7=E9=94=81=E5=AE=9AIsFull=3Dfalse=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E8=BF=87=E6=97=A9=E5=88=87=E6=8D=A2=20+=20=E9=BB=91=E5=9C=BA?= =?UTF-8?q?=E5=90=8E=E9=9A=90=E8=97=8Fman?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Step2 Shoot: 改为while循环每帧SetBool(IsFull,false),防止Animator中途切到manfull - Step3 Fall: 2.1s后停留1s再黑场(不再用_fallHoldDuration) - Step4 黑场: 新增 man 隐藏(_manAnimator.gameObject.SetActive(false)) - woman和maninjury在黑场期间显示,man/man2隐藏 --- .../Animation/OpeningFlowController.cs | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index 704471f..3797e84 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -105,31 +105,42 @@ public class OpeningFlowController : MonoBehaviour Debug.Log($"[OpeningFlow] Step1: man + man2 Idle ({_idleDuration}s)"); yield return new WaitForSeconds(_idleDuration); + // Step 2: Shoot —— 每帧强制 IsFull=false 防止 Animator 中途切走 Debug.Log("[OpeningFlow] Step2: man Shoot 动画开始"); if (_manAnimator != null) { _manAnimator.SetBool("IsFull", false); _manAnimator.SetBool("IsStart", true); - Debug.Log("[OpeningFlow] man IsStart=true, IsFull=false, 触发 Shoot"); - yield return new WaitForSeconds(3.15f); + Debug.Log("[OpeningFlow] man IsStart=true, IsFull=false, 触发 Shoot,每帧锁定 IsFull=false"); + + float shootElapsed = 0f; + while (shootElapsed < 3.15f) + { + shootElapsed += Time.deltaTime; + _manAnimator.SetBool("IsFull", false); + yield return null; + } _manAnimator.SetBool("IsStart", false); Debug.Log("[OpeningFlow] Step2: man Shoot 动画结束"); } + // Step 3: 摔倒 —— manfull 2.1s + 停留1s Debug.Log("[OpeningFlow] Step3: man Fall 动画开始"); if (_manAnimator != null) { _manAnimator.SetBool("IsFull", true); - Debug.Log("[OpeningFlow] man IsFull=true, 触发 manfull"); + Debug.Log("[OpeningFlow] man IsFull=true, 触发 manfull (2.1s)"); yield return new WaitForSeconds(2.1f); - Debug.Log("[OpeningFlow] Step3: man Fall 动画结束"); - yield return new WaitForSeconds(_fallHoldDuration); - Debug.Log($"[OpeningFlow] Step3: 摔倒后停留缓冲 {_fallHoldDuration}s 结束"); + Debug.Log("[OpeningFlow] Step3: man Fall 动画结束, 停留1s"); + yield return new WaitForSeconds(1f); } + // Step 4: 黑幕转场 —— 渐入 -> 切换角色+摄像机 -> 渐出 Debug.Log("[OpeningFlow] Step4: 黑幕转场开始"); yield return StartCoroutine(FadeBlackScreen(0f, 1f)); + // 隐藏 man 和 man2,显示 woman 和 maninjury + if (_manAnimator != null) { _manAnimator.gameObject.SetActive(false); Debug.Log("[OpeningFlow] man 已隐藏"); } if (_man2Object != null) { _man2Object.SetActive(false); Debug.Log("[OpeningFlow] man2 已隐藏"); } if (_womanObject != null) { _womanObject.SetActive(true); Debug.Log("[OpeningFlow] woman 已显示"); } if (_manInjuryObject != null) { _manInjuryObject.SetActive(true); Debug.Log("[OpeningFlow] maninjury 已显示"); }