refactor: Delete global loading & hook object

This commit is contained in:
AncTe committed 2026-09-30 12:30:42 +08:00
1 parent 7c155be5ce
commit d8fa4b8507
16 files changed
+33 -978

No files matched your search

@@ -9,7 +9,6 @@ import {
import { logger } from '@motajs/common';
import { IRenderItem, IRenderTreeRoot } from '@motajs/render';
import { Hotkey, gameKey } from '@motajs/system';
import { loading } from '@user/data-base';
import {
ComponentInternalInstance,
getCurrentInstance,
@@ -65,18 +64,6 @@ export function onOrientationChange(hook: OrientationHook) {
});
}
/**
* 当游戏加载完成时执行函数,如果调用此函数时游戏已经加载,那么会立刻调用传入的钩子函数
* @param hook 当游戏加载完成时执行的函数
*/
export function onLoaded(hook: () => void) {
if (!loading.loaded) {
loading.once('loaded', hook);
} else {
hook();
}
}
type KeyUsing = [Hotkey, symbol];
/**