@shimotsuki/core 2.0.33 → 2.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1007,7 +1007,10 @@ declare class TimerManager extends BaseManager {
1007
1007
  declare class Manager {
1008
1008
  #private;
1009
1009
  static get instance(): Manager;
1010
+ /**APP初始化事务 */
1010
1011
  readonly onAppInitDelegate: AsyncDelegate<() => (Promise<void> | void)>;
1012
+ /**插件初始化事务 */
1013
+ readonly onPlugInInitDelegate: AsyncDelegate<() => (Promise<void> | void)>;
1011
1014
  get audio(): AudioManager;
1012
1015
  get event(): EventEmitter$1<string | symbol, any>;
1013
1016
  get gui(): Gui;
package/dist/index.js CHANGED
@@ -2771,7 +2771,10 @@ class Manager {
2771
2771
  static get instance() {
2772
2772
  return this.#ins ?? (this.#ins = new Manager());
2773
2773
  }
2774
+ /**APP初始化事务 */
2774
2775
  onAppInitDelegate = new AsyncDelegate();
2776
+ /**插件初始化事务 */
2777
+ onPlugInInitDelegate = new AsyncDelegate();
2775
2778
  /**音频 */
2776
2779
  #audio = null;
2777
2780
  get audio() {
@@ -2855,7 +2858,7 @@ class Manager {
2855
2858
  if (typeof target !== 'string') {
2856
2859
  throw new Error(`merge方法第一个参数应该为string类型`);
2857
2860
  }
2858
- if (Reflect.get(this, target)) {
2861
+ if (!Reflect.get(this, target)) {
2859
2862
  Reflect.set(this, target, source);
2860
2863
  }
2861
2864
  Object.assign(Reflect.get(this, target), source);
@@ -2863,12 +2866,16 @@ class Manager {
2863
2866
  }
2864
2867
  }
2865
2868
  const cat = Manager.instance;
2866
- // 项目数据初始化之后的处理APP初始化事务
2869
+ /**
2870
+ * 项目数据初始化之后的处理APP初始化事务
2871
+ * 执行顺序 onAppInitDelegate -> onPlugInInitDelegate
2872
+ */
2867
2873
  game.onPostProjectInitDelegate.add(async () => {
2868
2874
  console.time('[Init App]');
2869
2875
  try {
2870
2876
  await cat.boot();
2871
2877
  await cat.onAppInitDelegate.dispatch();
2878
+ await cat.onPlugInInitDelegate.dispatch();
2872
2879
  }
2873
2880
  catch (err) {
2874
2881
  error(`[Init App] 初始化失败: ${err instanceof Error ? err.message : String(err)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shimotsuki/core",
3
- "version": "2.0.33",
3
+ "version": "2.0.35",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",