From b2714eb7a225970c06fa5c6d9c913f8a0202ddeb Mon Sep 17 00:00:00 2001 From: yangbear Date: Tue, 30 Jun 2026 23:10:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=80=E5=9C=BA=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E5=BC=80=E5=85=B3=20=5FenableOpeningFlow=20(Inspector=E5=8F=AF?= =?UTF-8?q?=E8=B0=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 [SerializeField] _enableOpeningFlow,默认true - 设为false时直接跳过动画,切场景状态后回调 - 方便调试验证后续功能 --- .../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 bd0dcef..57bb831 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -86,15 +86,22 @@ public class OpeningFlowController : MonoBehaviour public void PlayOpeningFlow(System.Action onComplete) { - Debug.Log("[OpeningFlow] PlayOpeningFlow() 被调用"); + Debug.Log($"[OpeningFlow] PlayOpeningFlow() 被调用, enable={_enableOpeningFlow}"); - if (_manAnimator != null) + if (!_enableOpeningFlow) { - _manAnimator.gameObject.SetActive(true); - _manAnimator.SetBool("IsStart", false); - _manAnimator.SetBool("IsFull", false); - _manAnimator.Play("manIdle", 0, 0f); + Debug.Log("[OpeningFlow] 开场动画已禁用,直接跳过"); + // 跳过动画但状态还是要切:隐藏man/man2,显示woman/manInjury,切camera2 + if (_manAnimator != null) _manAnimator.gameObject.SetActive(false); + if (_man2Object != null) _man2Object.SetActive(false); + if (_womanObject != null) _womanObject.SetActive(true); + if (_manInjuryObject != null) _manInjuryObject.SetActive(true); + SwitchToCamera2(); + onComplete?.Invoke(); + return; } + + if (_manAnimator != null) { _manAnimator.gameObject.SetActive(true); _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); _manAnimator.Play("manIdle", 0, 0f); } if (_man2Object != null) _man2Object.SetActive(true); if (_womanObject != null) _womanObject.SetActive(false); if (_manInjuryObject != null) _manInjuryObject.SetActive(false); @@ -195,4 +202,8 @@ public class OpeningFlowController : MonoBehaviour if (toAlpha <= 0.01f) _blackScreenPanel.SetActive(false); } + + + [Header("=== 开关 ===")] + [SerializeField] private bool _enableOpeningFlow = true; }