From 4d96165b2d9af4a0df2c33bc4b6dd75fad17eb58 Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 28 Jan 2026 17:22:16 +0800 Subject: [PATCH] =?UTF-8?q?refactor(map):=20=E7=A7=BB=E9=99=A4=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8D=A1=E7=89=87=E7=BB=84=E4=BB=B6=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E6=9B=B4=E6=96=B0=E4=BA=8B=E4=BB=B6=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理未使用的等级更新事件处理,避免潜在的内存泄漏 --- assets/script/game/map/MissionCardComp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 86771d93..d6e7c881 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -65,7 +65,7 @@ export class MissionCardComp extends CCComp { oops.message.on(GameEvent.MissionStart, this.onMissionStart, this); oops.message.on(GameEvent.MissionEnd, this.onMissionEnd, this); oops.message.on(GameEvent.ToCallFriend, this.onCallFriend, this); - oops.message.on(GameEvent.CanUpdateLv, this.onLevelUp, this); + // oops.message.on(GameEvent.CanUpdateLv, this.onLevelUp, this); } @@ -80,7 +80,7 @@ export class MissionCardComp extends CCComp { oops.message.off(GameEvent.MissionStart, this.onMissionStart, this); oops.message.off(GameEvent.MissionEnd, this.onMissionEnd, this); oops.message.off(GameEvent.ToCallFriend, this.onCallFriend, this); - oops.message.off(GameEvent.CanUpdateLv, this.onLevelUp, this); + // oops.message.off(GameEvent.CanUpdateLv, this.onLevelUp, this); this.ent.destroy(); }