@cc-component/cc-core 1.0.9 → 1.1.1

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.
@@ -41,7 +41,7 @@ export interface IConfig {
41
41
  /** Bundle配置 */
42
42
  bundle: {
43
43
  /** 默认bundle名称 */
44
- default: string;
44
+ default: string[];
45
45
  };
46
46
  }
47
47
 
@@ -10,6 +10,7 @@ import { Logger, LogType } from '../lib/Logger';
10
10
  import { ISceneParam } from '../interface/ISceneParam';
11
11
  import { BlockInputEvents } from 'cc';
12
12
  import { BaseLaunchComponent } from '../home/BaseLaunchComponent';
13
+ import { AssetManager } from 'cc';
13
14
  const { ccclass, property } = _decorator;
14
15
 
15
16
  @ccclass('LayerUI')
@@ -62,8 +63,11 @@ export class LayerUI {
62
63
  });
63
64
 
64
65
  //加载配置bundle
65
- const bundle = await ResourceManager.loadBundle(config.bundle.default);
66
- this.launch.InitGame();
66
+ const list: Promise<AssetManager.Bundle>[] = []
67
+ config.bundle.default.forEach(element => { list.push(ResourceManager.loadBundle(element)); });
68
+ Promise.all(list).then(() => {
69
+ this.launch.InitGame();
70
+ });
67
71
  }
68
72
 
69
73
  public static CreateNnode(name: string) {
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "10f538a9-c3bb-459d-bf59-f4d888da759d",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,13 @@
1
+
2
+
3
+ export class BaseModuleConfig {
4
+ public modules = new Map<string, any>();
5
+ public getModule<T>(name: string, factory: () => T): T {
6
+ if (!this.modules.has(name)) {
7
+ this.modules.set(name, factory());
8
+ }
9
+ return this.modules.get(name);
10
+ }
11
+ }
12
+
13
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-core",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",