From c078c929ce57ccce093de0ddf7f984c531ae5102 Mon Sep 17 00:00:00 2001 From: panw Date: Tue, 28 Apr 2026 16:20:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E5=BC=95=E5=AF=BC=E5=92=8C=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E6=B7=BB=E5=8A=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理 SingletonModuleComp 中未实际使用的代码,包括 finishGuide、addHero 和 error 方法,以保持代码简洁并减少维护负担。 --- .../script/game/common/SingletonModuleComp.ts | 17 ----------------- .../common/config}/hearthstone-battlegrounds.md | 0 2 files changed, 17 deletions(-) rename assets/script/{ => game/common/config}/hearthstone-battlegrounds.md (100%) diff --git a/assets/script/game/common/SingletonModuleComp.ts b/assets/script/game/common/SingletonModuleComp.ts index 3984f891..c65fced1 100644 --- a/assets/script/game/common/SingletonModuleComp.ts +++ b/assets/script/game/common/SingletonModuleComp.ts @@ -218,11 +218,6 @@ export class SingletonModuleComp extends ecs.Comp { isWxClient(): boolean { return gameDataSync.isWxClient(); } - - finishGuide(index:number){ - smc.guides[index]=1 - //存储到远程服务器 后续再添加 - } updateCloudData(){ return gameDataSync.updateCloudData(); @@ -279,13 +274,6 @@ export class SingletonModuleComp extends ecs.Comp { }; return data; } - addHero(hero_uuid:number){ - if(this.heros.indexOf(hero_uuid)==-1){ - this.heros.push(hero_uuid) - gameDataSync.markDataDirty(); - } - return true - } updateGold(gold:number, is_sync: boolean = true){ this.vmdata.gold += gold; @@ -295,11 +283,6 @@ export class SingletonModuleComp extends ecs.Comp { oops.message.dispatchEvent(GameEvent.GOLD_UPDATE) return true } - - error(){ - oops.gui.toast("数据处理异常,请重试或重新登录") - } - } export var smc: SingletonModuleComp = ecs.getSingleton(SingletonModuleComp); diff --git a/assets/script/hearthstone-battlegrounds.md b/assets/script/game/common/config/hearthstone-battlegrounds.md similarity index 100% rename from assets/script/hearthstone-battlegrounds.md rename to assets/script/game/common/config/hearthstone-battlegrounds.md