refactor(map): replace main node显隐操作转为动画控制

将原来通过查找main节点手动控制显隐的逻辑,替换为新增的MapLayer动画启停方法,简化代码逻辑并统一动画管理方式
This commit is contained in:
walkpan
2026-05-13 23:37:53 +08:00
parent 800f5d43da
commit 669aaf1ab9
2 changed files with 23 additions and 11 deletions

View File

@@ -80,10 +80,8 @@ export class MissionHomeComp extends CCComp {
this.node.active=false;
// 隐藏 mapLayer 下的 main 节点
let mainNode = smc.map.MapView.scene.mapLayer?.node.getChildByName("main");
if (mainNode) {
mainNode.active = false;
}
smc.map.MapView.scene.mapLayer?.stopAnimations();
}
/** 打开排行榜弹窗 */
@@ -106,12 +104,7 @@ export class MissionHomeComp extends CCComp {
home_active(){
this.uodate_data()
this.node.active=true
// 重新显示 mapLayer 下的 main 节点
let mainNode = smc.map.MapView.scene.mapLayer?.node.getChildByName("main");
if (mainNode) {
mainNode.active = true;
}
smc.map.MapView.scene.mapLayer?.playAnimations();
}
/** 更新主页显示数据(预留) */