From c1f1428d39376ceed5ed721d32de6b1a67940010 Mon Sep 17 00:00:00 2001 From: yangbear Date: Tue, 30 Jun 2026 00:52:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Idle=E7=BC=A9=E5=88=B01s=20+=20=E6=91=94?= =?UTF-8?q?=E5=80=92=E6=94=B9=E7=94=A8Play=E7=9B=B4=E6=8E=A5=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E9=81=BF=E5=85=8D=E8=A2=ABAnimator=E8=BF=87=E6=B8=A1?= =?UTF-8?q?=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Idle从2s缩短到1s - Fall不再依赖SetBool+Animator过渡,改用Play("manfull")直接播放 - 摔倒后停留2s确保看清 --- .../Characters/Man}/manInjury.fbx | Bin .../Characters/Man}/manInjury.fbx.meta | 0 .../Animation/OpeningFlowController.cs | 39 +++++++++--------- 3 files changed, 20 insertions(+), 19 deletions(-) rename Assets/{Animations => Models/Characters/Man}/manInjury.fbx (100%) rename Assets/{Animations => Models/Characters/Man}/manInjury.fbx.meta (100%) diff --git a/Assets/Animations/manInjury.fbx b/Assets/Models/Characters/Man/manInjury.fbx similarity index 100% rename from Assets/Animations/manInjury.fbx rename to Assets/Models/Characters/Man/manInjury.fbx diff --git a/Assets/Animations/manInjury.fbx.meta b/Assets/Models/Characters/Man/manInjury.fbx.meta similarity index 100% rename from Assets/Animations/manInjury.fbx.meta rename to Assets/Models/Characters/Man/manInjury.fbx.meta diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index 8726551..7e28c64 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -94,51 +94,52 @@ public class OpeningFlowController : MonoBehaviour { Debug.Log("=== [OpeningFlow] 片头动画流程开始 ==="); - // 重置参数,让 Animator 默认进入 Idle(不调用 Play 避免重复触发) + // 重置参数,让 Animator 默认进入 Idle if (_manAnimator != null) { _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); - Debug.Log("[OpeningFlow] man Animator 已重置: IsStart=false, IsFull=false, 默认 Idle"); + Debug.Log("[OpeningFlow] man Animator 已重置, 默认 Idle"); } - // Step 1: Idle 2s - Debug.Log($"[OpeningFlow] Step1: man + man2 Idle ({_idleDuration}s)"); - yield return new WaitForSeconds(_idleDuration); + // Step 1: Idle 1s + Debug.Log("[OpeningFlow] Step1: man + man2 Idle (1s)"); + yield return new WaitForSeconds(1f); - // Step 2: Shoot —— 每帧锁定 IsFull=false - Debug.Log("[OpeningFlow] Step2: man Shoot 动画开始"); + // Step 2: Shoot (3.15s) —— 每帧锁 IsFull=false + Debug.Log("[OpeningFlow] Step2: man Shoot 开始 (3.15s)"); if (_manAnimator != null) { _manAnimator.SetBool("IsFull", false); _manAnimator.SetBool("IsStart", true); - Debug.Log("[OpeningFlow] man IsStart=true, IsFull=false, 触发 Shoot"); - float shootElapsed = 0f; - while (shootElapsed < 3.15f) + float t = 0f; + while (t < 3.15f) { - shootElapsed += Time.deltaTime; + t += Time.deltaTime; _manAnimator.SetBool("IsFull", false); yield return null; } - - // 关键:先设 IsFull=true 再清 IsStart,避免回到 Idle 闪一下 - _manAnimator.SetBool("IsFull", true); _manAnimator.SetBool("IsStart", false); - Debug.Log("[OpeningFlow] man IsStart=false, IsFull=true, 触发 manfull"); + Debug.Log("[OpeningFlow] Step2: Shoot 结束"); } - // Step 3: 摔倒 manfull (2.1s) + 看清停留 2s - Debug.Log("[OpeningFlow] Step3: man Fall 动画 (2.1s) + 停留 2s"); + // Step 3: 摔倒 —— 直接用 Play 保证播放,不走 Animator 过渡 + Debug.Log("[OpeningFlow] Step3: manfall 开始 (直接 Play)"); + if (_manAnimator != null) + { + _manAnimator.Play("manfull", 0, 0f); + Debug.Log("[OpeningFlow] manfull 已触发, 等待 2.1s"); + } yield return new WaitForSeconds(2.1f); - Debug.Log("[OpeningFlow] Step3: man Fall 动画结束, 停留 2s 让玩家看清摔倒"); + Debug.Log("[OpeningFlow] manfull 播放完成, 停留 2s"); yield return new WaitForSeconds(2f); // Step 4: 黑幕转场 Debug.Log("[OpeningFlow] Step4: 黑幕转场开始"); yield return StartCoroutine(FadeBlackScreen(0f, 1f)); - // 隐藏 man 和 man2,显示 woman 和 maninjury + // 隐藏 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 已显示"); }