fix: 修复第二次进入时UI显示和转场时序问题
主要修复:
1. 移除 init3DScene 中的 is2DInitialized 重置(避免时序混乱)
2. 在 switchTo2D 中显式隐藏 uiLayer 和 hint(display: none)
3. 确保地图界面不会显示3D场景的UI元素
解决的问题:
- 第二次进入时动画播放完整
- 地图界面不会显示"点击地球"按钮
- 转场逻辑更加清晰和可靠
🤖 Generated with Claude Code
This commit is contained in:
@@ -115,9 +115,6 @@ class App {
|
||||
this.sceneManager = null;
|
||||
}
|
||||
|
||||
// 重置2D地图初始化标志
|
||||
this.is2DInitialized = false;
|
||||
|
||||
// 重置UI状态
|
||||
this.canvasContainer.style.display = 'block';
|
||||
this.speedLines.style.display = 'block';
|
||||
@@ -126,7 +123,7 @@ class App {
|
||||
this.mapInterface.style.display = 'none';
|
||||
this.mapInterface.style.opacity = '0';
|
||||
|
||||
// 重置UI层和提示文字的状态(关键修复)
|
||||
// 重置UI层和提示文字的状态(确保第二次进入时能正常显示)
|
||||
this.uiLayer.style.opacity = '0';
|
||||
this.uiLayer.style.display = 'flex';
|
||||
this.hint.style.opacity = '0';
|
||||
@@ -170,6 +167,10 @@ class App {
|
||||
this.canvasContainer.style.display = 'none';
|
||||
this.speedLines.style.display = 'none';
|
||||
|
||||
// 隐藏3D场景的UI元素(关键修复)
|
||||
this.uiLayer.style.display = 'none';
|
||||
this.hint.style.display = 'none';
|
||||
|
||||
// 先显示地图容器(opacity: 0,但display: block)
|
||||
this.mapInterface.style.display = 'block';
|
||||
this.mapInterface.style.opacity = '0';
|
||||
|
||||
Reference in New Issue
Block a user