From e3a9d447ba47ad3b9502e366445502fe7b4e5fa5 Mon Sep 17 00:00:00 2001 From: walkpan Date: Wed, 13 May 2026 23:45:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(map):=20=E4=BF=AE=E5=A4=8D=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=95=8C=E9=9D=A2=E5=8A=A8=E7=94=BB=E5=90=AF=E5=81=9C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整了MissionHomeComp和MissionComp中的地图动画启停代码,将多余空行移除并修正了调用时机,确保界面切换和销毁时动画状态正确。 --- assets/script/game/map/MissionComp.ts | 2 ++ assets/script/game/map/MissionHomeComp.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 44b9b9d6..26c5793f 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -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); diff --git a/assets/script/game/map/MissionHomeComp.ts b/assets/script/game/map/MissionHomeComp.ts index 6ba09bfb..9a8edae3 100644 --- a/assets/script/game/map/MissionHomeComp.ts +++ b/assets/script/game/map/MissionHomeComp.ts @@ -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(); + } /** 更新主页显示数据(预留) */