mirror of
https://github.com/Gongxh0901/kunpolibrary
synced 2025-10-09 16:45:45 +00:00
修复未配置GameEntiry中的ecConfig时报错的问题
This commit is contained in:
@@ -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