fix: Shoot期间每帧锁定IsFull=false防止过早切换 + 黑场后隐藏man

- Step2 Shoot: 改为while循环每帧SetBool(IsFull,false),防止Animator中途切到manfull
- Step3 Fall: 2.1s后停留1s再黑场(不再用_fallHoldDuration)
- Step4 黑场: 新增 man 隐藏(_manAnimator.gameObject.SetActive(false))
- woman和maninjury在黑场期间显示,man/man2隐藏
This commit is contained in:
yangbear
2026-06-29 20:54:39 +08:00
parent 34c57b51fe
commit c38016ce26
@@ -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 已显示"); }