fix(map): 修复任务界面动画启停逻辑异常
调整了MissionHomeComp和MissionComp中的地图动画启停代码,将多余空行移除并修正了调用时机,确保界面切换和销毁时动画状态正确。
This commit is contained in:
@@ -198,9 +198,11 @@ export class MissionComp extends CCComp {
|
|||||||
oops.message.dispatchEvent(GameEvent.MissionStart, {});
|
oops.message.dispatchEvent(GameEvent.MissionStart, {});
|
||||||
this.mission_start();
|
this.mission_start();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
smc.map.MapView.scene.mapLayer.stopAnimations();
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy(){
|
onDestroy(){
|
||||||
|
smc.map.MapView.scene.mapLayer.playAnimations()
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (this.start_btn && this.start_btn.isValid) {
|
if (this.start_btn && this.start_btn.isValid) {
|
||||||
this.start_btn.off(NodeEventType.TOUCH_END, this.onStartFightBtnClick, this);
|
this.start_btn.off(NodeEventType.TOUCH_END, this.onStartFightBtnClick, this);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class MissionHomeComp extends CCComp {
|
|||||||
this.node.active=false;
|
this.node.active=false;
|
||||||
|
|
||||||
// 隐藏 mapLayer 下的 main 节点
|
// 隐藏 mapLayer 下的 main 节点
|
||||||
smc.map.MapView.scene.mapLayer?.stopAnimations();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ export class MissionHomeComp extends CCComp {
|
|||||||
home_active(){
|
home_active(){
|
||||||
this.uodate_data()
|
this.uodate_data()
|
||||||
this.node.active=true
|
this.node.active=true
|
||||||
smc.map.MapView.scene.mapLayer?.playAnimations();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 更新主页显示数据(预留) */
|
/** 更新主页显示数据(预留) */
|
||||||
|
|||||||
Reference in New Issue
Block a user