@cc-component/cc-core 1.2.5 → 1.2.6
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.
|
@@ -29,7 +29,7 @@ export class i18nEditorComponent extends Component {
|
|
|
29
29
|
await this.loadConfig()
|
|
30
30
|
LanguageData.current = language
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
console.log("编辑器语言设置成功", language);
|
|
33
33
|
// MainModule.language.setLanguage('', language)
|
|
34
34
|
// this.node.children.forEach(child => {
|
|
35
35
|
// console.error(child.name)
|
|
@@ -68,7 +68,7 @@ export class i18nEditorComponent extends Component {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
public editorChangeBundle(language: string) {
|
|
71
|
-
|
|
71
|
+
console.log("bundle", language);
|
|
72
72
|
MainModule.language.setLanguage('', language)
|
|
73
73
|
//i18nMgr.editorChangeBundle(language);
|
|
74
74
|
}
|
|
@@ -89,7 +89,7 @@ export class i18nEditorComponent extends Component {
|
|
|
89
89
|
/**编辑器环境下改变多语言 */
|
|
90
90
|
public async changeLabel(dbUrl: string, language?: string) {
|
|
91
91
|
const db_json = dbUrl + `/${MainModule.gui.config.language.path.json}/${language}.json`
|
|
92
|
-
|
|
92
|
+
console.log(db_json)
|
|
93
93
|
let uuid = await Editor.Message.request("asset-db", "query-uuid", db_json);
|
|
94
94
|
assetManager.loadAny(uuid, (err, jsonAsset: JsonAsset) => {
|
|
95
95
|
// Logger.debug("加载表格", jsonAsset, err);
|
|
@@ -77,12 +77,11 @@ export class ResourceManager {
|
|
|
77
77
|
if (record) {
|
|
78
78
|
let { asset } = record;
|
|
79
79
|
record.refCount--;
|
|
80
|
-
ResourceManager.instance.LogAssets(bundleName)
|
|
81
80
|
if (record.refCount <= 0) {
|
|
82
81
|
asset.decRef(); // 减少引用计数
|
|
83
82
|
this.loadedAssets.delete(key);
|
|
84
|
-
|
|
85
83
|
}
|
|
84
|
+
ResourceManager.instance.LogAssets(bundleName)
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
|
|
@@ -208,7 +207,7 @@ export class ResourceManager {
|
|
|
208
207
|
list.push({ name: asset.name, refCount: asset.refCount })
|
|
209
208
|
}
|
|
210
209
|
});
|
|
211
|
-
Logger.
|
|
210
|
+
Logger.debug("资源计数:\n", list)
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
LogAssetsAll() {
|
|
@@ -71,8 +71,7 @@ export class MainModule {
|
|
|
71
71
|
private openWindowLayer: Map<string, string[]> = new Map();
|
|
72
72
|
|
|
73
73
|
static async InitGameConfig(param: IInitConfig) {
|
|
74
|
-
if (MainModule.Ins._gui) { return }
|
|
75
|
-
|
|
74
|
+
if (!EDITOR) { if (MainModule.Ins._gui) { return } }
|
|
76
75
|
/**资源下载配置 */
|
|
77
76
|
assetManager.downloader.maxConcurrency = 10;
|
|
78
77
|
assetManager.downloader.maxRequestsPerFrame = 6;
|
|
@@ -94,8 +93,10 @@ export class MainModule {
|
|
|
94
93
|
// 免网络
|
|
95
94
|
self._http.server = config.httpServer;
|
|
96
95
|
self._http.timeout = config.httpTimeout;
|
|
96
|
+
Logger.debug("初始化完成")
|
|
97
|
+
} else {
|
|
98
|
+
console.log("初始化完成")
|
|
97
99
|
}
|
|
98
|
-
Logger.debug("初始化完成")
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
static OpenLoading(is_show: boolean) {
|
|
@@ -140,7 +140,7 @@ export class LanguageLabel extends Component {
|
|
|
140
140
|
|
|
141
141
|
async addEditor() {
|
|
142
142
|
if (EDITOR) {
|
|
143
|
-
await MainModule.InitGameConfig()
|
|
143
|
+
await MainModule.InitGameConfig({ bundleName: 'resources', launchComponent: null })
|
|
144
144
|
MainModule.language.addEditorLabel(this);
|
|
145
145
|
this.changeLabelEditor()
|
|
146
146
|
} else {
|
|
@@ -85,7 +85,7 @@ export class LanguageSprite extends Component {
|
|
|
85
85
|
//#endregion编辑器
|
|
86
86
|
async addEditor() {
|
|
87
87
|
if (EDITOR) {
|
|
88
|
-
await MainModule.InitGameConfig()
|
|
88
|
+
await MainModule.InitGameConfig({ bundleName: 'resources', launchComponent: null })
|
|
89
89
|
MainModule.language.addEditorSprite(this);
|
|
90
90
|
this.changeSpriteEditor()
|
|
91
91
|
} else {
|