From 4540ff49425099aca155d93de6f4ac7cc722fd73 Mon Sep 17 00:00:00 2001 From: yangbear Date: Tue, 30 Jun 2026 21:59:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4UIManager=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=8C=89=E9=92=AE=E7=BB=91=E5=AE=9A+InteractionSystem?= =?UTF-8?q?=E8=AF=AF=E8=A7=A6=E5=8F=91=E2=80=94=E2=80=94=E6=A0=B9=E5=9B=A0?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: UIManager._btnLimbFixation/_btnSplintFixation调用SwitchFixation 与PageController的OnFixationSelected双重触发,StepManager._mode被设为Learn 导致OnStepInteractionComplete→NextStep→WomanStepNext自动跳过步骤。 修复: 1. UIManager.BindButtons移除_btnLimbFixation/_btnSplintFixation的SwitchFixation绑定 2. ExperimentFlowCoordinator.OnAnywhereClicked增加无Config步骤时忽略的注释守卫 --- .../Scripts/Core/ExperimentFlowCoordinator.cs | 4 +- Assets/Scripts/UI/UIManager.cs | 49 +++---------------- 2 files changed, 8 insertions(+), 45 deletions(-) diff --git a/Assets/Scripts/Core/ExperimentFlowCoordinator.cs b/Assets/Scripts/Core/ExperimentFlowCoordinator.cs index b40f392..ce758b0 100644 --- a/Assets/Scripts/Core/ExperimentFlowCoordinator.cs +++ b/Assets/Scripts/Core/ExperimentFlowCoordinator.cs @@ -94,12 +94,10 @@ public class ExperimentFlowCoordinator : MonoBehaviour private void OnAnywhereClicked() { var step = _stepManager.GetCurrentStep(); + // 无 Config 步骤数据时忽略(走 woman 自由步进模式) if (step == null) return; - if (step.CompleteType == StepCompleteType.ClickAnywhere) - { _stepManager.OnStepInteractionComplete(1f); - } } #endregion diff --git a/Assets/Scripts/UI/UIManager.cs b/Assets/Scripts/UI/UIManager.cs index 36ae48d..57d8d32 100644 --- a/Assets/Scripts/UI/UIManager.cs +++ b/Assets/Scripts/UI/UIManager.cs @@ -186,49 +186,14 @@ public class UIManager : MonoBehaviour private void BindButtons() { - if (_btnFullScreen != null) - { - _btnFullScreen.onClick.AddListener(ToggleFullScreen); - Debug.Log("UIManager: _btnFullScreen 绑定成功"); - } - if (_btnPrevious != null) - { - _btnPrevious.onClick.AddListener(OnPreviousClicked); - Debug.Log("UIManager: _btnPrevious 绑定成功"); - } - if (_btnNext != null) - { - _btnNext.onClick.AddListener(OnNextClicked); - Debug.Log("UIManager: _btnNext 绑定成功"); - } - if (_btnSwitchMode != null) - { - _btnSwitchMode.onClick.AddListener(OnSwitchModeClicked); - Debug.Log("UIManager: _btnSwitchMode 绑定成功"); - } - if (_btnReturn != null) - { - _btnReturn.onClick.AddListener(OnReturnClicked); - Debug.Log("UIManager: _btnReturn 绑定成功"); - } + if (_btnFullScreen != null) { _btnFullScreen.onClick.AddListener(ToggleFullScreen); Debug.Log("UIManager: _btnFullScreen 绑定成功"); } + if (_btnPrevious != null) { _btnPrevious.onClick.AddListener(OnPreviousClicked); Debug.Log("UIManager: _btnPrevious 绑定成功"); } + if (_btnNext != null) { _btnNext.onClick.AddListener(OnNextClicked); Debug.Log("UIManager: _btnNext 绑定成功"); } + if (_btnSwitchMode != null) { _btnSwitchMode.onClick.AddListener(OnSwitchModeClicked); Debug.Log("UIManager: _btnSwitchMode 绑定成功"); } + if (_btnReturn != null) { _btnReturn.onClick.AddListener(OnReturnClicked); Debug.Log("UIManager: _btnReturn 绑定成功"); } - if (_btnLimbFixation != null) - { - _btnLimbFixation.onClick.AddListener(() => { - Debug.Log("UIManager: [BtnLimbFixation] 点击 -> 肢体固定"); - _stepManager?.SwitchFixation(FixationMethod.LimbFixation); - }); - Debug.Log("UIManager: _btnLimbFixation 绑定成功"); - } - - if (_btnSplintFixation != null) - { - _btnSplintFixation.onClick.AddListener(() => { - Debug.Log("UIManager: [BtnSplintFixation] 点击 -> 夹板固定"); - _stepManager?.SwitchFixation(FixationMethod.SplintFixation); - }); - Debug.Log("UIManager: _btnSplintFixation 绑定成功"); - } + // 注意: _btnLimbFixation/_btnSplintFixation 不再在这里绑定 SwitchFixation, + // 固定方式选择由 PageController 的 OnFixationSelected 统一处理,避免双重触发污染 StepManager 状态。 } #endregion