feat: 开场动画开关 _enableOpeningFlow (Inspector可调)

- 新增 [SerializeField] _enableOpeningFlow,默认true
- 设为false时直接跳过动画,切场景状态后回调
- 方便调试验证后续功能
This commit is contained in:
yangbear
2026-06-30 23:10:08 +08:00
parent 5778de59ab
commit b2714eb7a2
@@ -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;
}