From 3034bf944aa950b136d62840deee2635a9dcd08d Mon Sep 17 00:00:00 2001 From: dgflash Date: Mon, 29 Jun 2026 18:29:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/module/common/part/GamePartAudio.ts | 3 ++- assets/module/common/part/GamePartButton.ts | 2 +- assets/module/common/part/GamePartEvent.ts | 3 ++- assets/module/common/part/GamePartKeyboard.ts | 2 +- assets/module/common/part/GamePartNode.ts | 2 +- assets/module/common/part/GamePartNodePool.ts | 16 ++++++++++++---- assets/module/common/part/GamePartRes.ts | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/assets/module/common/part/GamePartAudio.ts b/assets/module/common/part/GamePartAudio.ts index faa891a..0254f7d 100644 --- a/assets/module/common/part/GamePartAudio.ts +++ b/assets/module/common/part/GamePartAudio.ts @@ -120,7 +120,8 @@ export class GamePartAudio extends GamePartBase { if (isRemote) { // 加载远程资源(ResAutoTracker 自动管理) return await this.comp.res.loadRemote(url); - } else { + } + else { // 加载本地资源(ResAutoTracker 自动管理) return await this.comp.res.load(bundle, url, AudioClip); } diff --git a/assets/module/common/part/GamePartButton.ts b/assets/module/common/part/GamePartButton.ts index b7372e3..6314f62 100644 --- a/assets/module/common/part/GamePartButton.ts +++ b/assets/module/common/part/GamePartButton.ts @@ -43,4 +43,4 @@ export class GamePartButton extends GamePartBase { } }); } -} \ No newline at end of file +} diff --git a/assets/module/common/part/GamePartEvent.ts b/assets/module/common/part/GamePartEvent.ts index 7bb7b96..a35caa5 100644 --- a/assets/module/common/part/GamePartEvent.ts +++ b/assets/module/common/part/GamePartEvent.ts @@ -127,7 +127,8 @@ export class GamePartEvent extends GamePartBase { const func = self[name]; if (func) { this.on(name, func, this.comp); - } else { + } + else { console.error(`名为【${name}】的全局事方法不存在`); } } diff --git a/assets/module/common/part/GamePartKeyboard.ts b/assets/module/common/part/GamePartKeyboard.ts index a92582c..141dadb 100644 --- a/assets/module/common/part/GamePartKeyboard.ts +++ b/assets/module/common/part/GamePartKeyboard.ts @@ -78,4 +78,4 @@ export class GamePartKeyboard extends GamePartBase { input.off(Input.EventType.KEY_PRESSING, callbacks.onKeyPressing, this.comp); } } -} \ No newline at end of file +} diff --git a/assets/module/common/part/GamePartNode.ts b/assets/module/common/part/GamePartNode.ts index a994bc5..3a18123 100644 --- a/assets/module/common/part/GamePartNode.ts +++ b/assets/module/common/part/GamePartNode.ts @@ -96,4 +96,4 @@ export class GamePartNode extends GamePartBase { this._nodes?.clear(); this._nodes = null; } -} \ No newline at end of file +} diff --git a/assets/module/common/part/GamePartNodePool.ts b/assets/module/common/part/GamePartNodePool.ts index 2978fdd..9de6878 100644 --- a/assets/module/common/part/GamePartNodePool.ts +++ b/assets/module/common/part/GamePartNodePool.ts @@ -51,9 +51,13 @@ export class GamePartNodePool extends GamePartBase { private _speed = 1; /** 获取全局动画播放速度 */ - get speed(): number { return this._speed; } + get speed(): number { + return this._speed; + } /** 设置全局动画播放速度 */ - set speed(value: number) { this._speed = value; } + set speed(value: number) { + this._speed = value; + } /** * 获取指定资源池中对象数量 @@ -98,7 +102,9 @@ export class GamePartNodePool extends GamePartBase { } /** 回收对象 */ - put(node: Node) { gameNodePool.put(node); } + put(node: Node) { + gameNodePool.put(node); + } /** * 清除对象池数据(只清除本模块管理的) @@ -175,5 +181,7 @@ export class GamePartNodePool extends GamePartBase { } /** 销毁特效模块 */ - override destroy(): void { this.release(); } + override destroy(): void { + this.release(); + } } diff --git a/assets/module/common/part/GamePartRes.ts b/assets/module/common/part/GamePartRes.ts index 9bc182d..68eef32 100644 --- a/assets/module/common/part/GamePartRes.ts +++ b/assets/module/common/part/GamePartRes.ts @@ -139,4 +139,4 @@ export class GamePartRes extends GamePartBase { target.spriteFrame = spriteFrame; return true; } -} \ No newline at end of file +}