fix: 修复第二次进入时UI不显示和转场自动触发的问题

- 在 init3DScene() 中清除 uiLayer 和 hint 的内联 opacity 样式
- 在 SceneManager 中保存事件处理器引用
- 在 dispose() 中正确移除所有事件监听器
- 防止事件监听器重复绑定导致的意外触发

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
KQL
2025-12-04 19:53:37 +08:00
parent d4875b655c
commit 4bf7dcde79
2 changed files with 26 additions and 7 deletions

View File

@@ -126,10 +126,11 @@ class App {
this.mapInterface.style.display = 'none';
this.mapInterface.style.opacity = '0';
// 重置UI层和提示文字的状态
// 重置UI层和提示文字的状态(清除转场时设置的内联样式)
this.uiLayer.style.display = 'block';
this.uiLayer.style.opacity = ''; // 清除内联opacity让CSS和GSAP控制
this.hint.style.display = 'block';
// 不设置 opacity让GSAP的 fromTo() 控制
this.hint.style.opacity = ''; // 清除内联opacity
// 创建场景管理器
this.sceneManager = new SceneManager(