fix(map): 修复任务界面动画启停逻辑异常

调整了MissionHomeComp和MissionComp中的地图动画启停代码,将多余空行移除并修正了调用时机,确保界面切换和销毁时动画状态正确。
This commit is contained in:
walkpan
2026-05-13 23:45:38 +08:00
parent 669aaf1ab9
commit e3a9d447ba
2 changed files with 4 additions and 2 deletions

View File

@@ -198,9 +198,11 @@ export class MissionComp extends CCComp {
oops.message.dispatchEvent(GameEvent.MissionStart, {});
this.mission_start();
}, 0);
smc.map.MapView.scene.mapLayer.stopAnimations();
}
onDestroy(){
smc.map.MapView.scene.mapLayer.playAnimations()
super.onDestroy();
if (this.start_btn && this.start_btn.isValid) {
this.start_btn.off(NodeEventType.TOUCH_END, this.onStartFightBtnClick, this);

View File

@@ -80,7 +80,7 @@ export class MissionHomeComp extends CCComp {
this.node.active=false;
// 隐藏 mapLayer 下的 main 节点
smc.map.MapView.scene.mapLayer?.stopAnimations();
}
@@ -104,7 +104,7 @@ export class MissionHomeComp extends CCComp {
home_active(){
this.uodate_data()
this.node.active=true
smc.map.MapView.scene.mapLayer?.playAnimations();
}
/** 更新主页显示数据(预留) */