fix: 移除UIManager重复按钮绑定+InteractionSystem误触发——根因修复

根因: UIManager._btnLimbFixation/_btnSplintFixation调用SwitchFixation
与PageController的OnFixationSelected双重触发,StepManager._mode被设为Learn
导致OnStepInteractionComplete→NextStep→WomanStepNext自动跳过步骤。

修复:
1. UIManager.BindButtons移除_btnLimbFixation/_btnSplintFixation的SwitchFixation绑定
2. ExperimentFlowCoordinator.OnAnywhereClicked增加无Config步骤时忽略的注释守卫
This commit is contained in:
yangbear
2026-06-30 21:59:47 +08:00
parent 7519b37ee6
commit 4540ff4942
2 changed files with 8 additions and 45 deletions
@@ -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
+7 -42
View File
@@ -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