@cc-component/cc-core 1.0.8 → 1.1.0
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.
|
@@ -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
|
|
66
|
-
|
|
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) {
|
|
@@ -107,6 +107,14 @@ declare global {
|
|
|
107
107
|
//MainModule.On(SystemMessage.OpenWindow)
|
|
108
108
|
/**✅✅✅监听窗口的关闭 */
|
|
109
109
|
//MainModule.On(SystemMessage.CloseWindow)
|
|
110
|
+
/**获取所有已打开的窗口名称 */
|
|
111
|
+
function GetOpenedWindowNames(): string[]
|
|
112
|
+
/**获取已打开的窗口实例*/
|
|
113
|
+
function GetOpenWindow<T extends Component>(config: IBundleConfig): T;
|
|
114
|
+
// 获取已打开的窗口实例-对象
|
|
115
|
+
function GetOpenWindows<T extends Component>(): T[]
|
|
116
|
+
// 获取已打开的窗口实例-配置
|
|
117
|
+
function GetOpenWindowsConfig(): IBundleConfig[];
|
|
110
118
|
/**
|
|
111
119
|
* 显示加载转圈
|
|
112
120
|
*/
|
|
@@ -16,8 +16,6 @@ import { TimeManager } from "../home/TimeManager";
|
|
|
16
16
|
import { LanguageManager } from "../lib/language/Language";
|
|
17
17
|
import { BundleConfigName, HttpType, IBundleConfig, IExtData, IHttpConfig, IInitConfig, IWindowParam, SystemMessage } from "../config/CommonEnum";
|
|
18
18
|
import { LayerType } from "../config/LayerType";
|
|
19
|
-
import { Logger } from "../lib/Logger";
|
|
20
|
-
import { Main } from "electron";
|
|
21
19
|
|
|
22
20
|
|
|
23
21
|
// const { keepClassName } = keepClass;
|
|
@@ -942,12 +940,21 @@ export class MainModule {
|
|
|
942
940
|
}
|
|
943
941
|
|
|
944
942
|
// 获取已打开的窗口实例
|
|
945
|
-
static GetOpenWindow<T extends Component>(config: IBundleConfig): T
|
|
943
|
+
static GetOpenWindow<T extends Component>(config: IBundleConfig): T {
|
|
946
944
|
const className = config.path.split('/').pop();
|
|
947
945
|
const window = MainModule.Ins.openedWindows.get(className);
|
|
948
946
|
return window ? window as T : null;
|
|
949
947
|
}
|
|
948
|
+
// 获取已打开的窗口实例
|
|
949
|
+
static GetOpenWindows<T extends Component>(): T[] {
|
|
950
|
+
return Array.from(MainModule.Ins.openedWindows.values()) as T[];
|
|
950
951
|
|
|
952
|
+
}
|
|
953
|
+
// 获取已打开的窗口实例
|
|
954
|
+
static GetOpenWindowsConfig(): IBundleConfig[] {
|
|
955
|
+
return Array.from(MainModule.Ins.openedWindowsConfig.values());
|
|
956
|
+
|
|
957
|
+
}
|
|
951
958
|
// 获取所有已打开的窗口名称
|
|
952
959
|
static GetOpenedWindowNames(): string[] {
|
|
953
960
|
return Array.from(MainModule.Ins.openedWindows.keys());
|