mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-09-03 04:03:46 +08:00
优化
This commit is contained in:
@@ -120,7 +120,8 @@ export class GamePartAudio extends GamePartBase {
|
||||
if (isRemote) {
|
||||
// 加载远程资源(ResAutoTracker 自动管理)
|
||||
return await this.comp.res.loadRemote<AudioClip>(url);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// 加载本地资源(ResAutoTracker 自动管理)
|
||||
return await this.comp.res.load(bundle, url, AudioClip);
|
||||
}
|
||||
|
||||
@@ -43,4 +43,4 @@ export class GamePartButton extends GamePartBase {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}】的全局事方法不存在`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,4 +78,4 @@ export class GamePartKeyboard extends GamePartBase {
|
||||
input.off(Input.EventType.KEY_PRESSING, callbacks.onKeyPressing, this.comp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,4 +96,4 @@ export class GamePartNode extends GamePartBase {
|
||||
this._nodes?.clear();
|
||||
this._nodes = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,4 +139,4 @@ export class GamePartRes extends GamePartBase {
|
||||
target.spriteFrame = spriteFrame;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user