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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user