mirror of
https://github.com/Gongxh0901/kunpolibrary
synced 2025-10-09 08:35:53 +00:00
修复未配置GameEntiry中的ecConfig时报错的问题
This commit is contained in:
@@ -18,3 +18,5 @@
|
||||
- UI模块添加fgui控制器和动画装饰器,详情见 [UI模块](./docs/UI.md)
|
||||
## 1.0.34
|
||||
- 兼容性修改,兼容creator3.7及之后的版本
|
||||
## 1.0.35
|
||||
- 修复未配置GameEntiry中的ecConfig时报错的问题
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kunpocc",
|
||||
"version": "1.0.34",
|
||||
"version": "1.0.35",
|
||||
"description": "基于creator3.0+的kunpocc库",
|
||||
"main": "./dist/kunpocc.cjs",
|
||||
"module": "./dist/kunpocc.mjs",
|
||||
|
@@ -48,7 +48,7 @@ export abstract class CocosEntry extends Component {
|
||||
director.addPersistRootNode(this.node);
|
||||
this.node.setSiblingIndex(this.node.children.length - 1);
|
||||
PropsHelper.setConfig(this.uiConfig?.json);
|
||||
ECManager.registerEntityConfig(this.ecConfig?.json);
|
||||
this.ecConfig && ECManager.registerEntityConfig(this.ecConfig.json);
|
||||
this.initPlatform();
|
||||
this.initEvent();
|
||||
this.initTime();
|
||||
|
@@ -86,6 +86,9 @@ export class ECManager {
|
||||
* @param config 实体配置信息,格式为 {实体名: {组件名: 组件数据}}
|
||||
*/
|
||||
public static registerEntityConfig(config: { [entityName: string]: IEntityConfig }): void {
|
||||
if (!config) {
|
||||
return;
|
||||
}
|
||||
// 遍历并注册每个实体的配置
|
||||
for (const entityName in config) {
|
||||
this._entityList[entityName] = config[entityName];
|
||||
|
Reference in New Issue
Block a user