feat: 优化各种性能表现

This commit is contained in:
AncTe committed 2024-11-07 20:01:00 +08:00
1 parent 740dfdb6ce
commit 7e5b20d3ad
10 files changed
+75 -480

No files matched your search

+1 -1
View File
@@ -85,7 +85,7 @@ export class SoundEffect extends AudioPlayer {
* @returns 音频的唯一id
*/
playSE() {
if (SoundEffect.disable) return;
if (SoundEffect.disable || this.volumn === 0) return;
const node = this.play();
if (!node) return;
const index = SoundEffect.playIndex++;
+1
View File
@@ -159,6 +159,7 @@ export class Portal extends Sprite {
}
private renderPortal(canvas: MotaOffscreenCanvas2D) {
if (this.renderable.size === 0) return;
const { ctx } = canvas;
const p = this.particleSetting.value;
-13
View File
@@ -1075,19 +1075,6 @@ interface Core extends Pick<Main, CoreDataFromMain> {
*/
init(coreData: MainData, callback?: () => void): Promise<void>;
/**
* @deprecated
* 在一个上下文下执行函数(真的有人会用这个东西吗?
* @param func 要执行的函数
* @param _this 执行函数的上下文
* @param params 函数的参数
*/
doFunc<F extends (...args: any) => any>(
func: F,
_this: any,
...params: Parameters<F>
): ReturnType<F>;
_afterLoadResources(callback?: () => void): void;
}