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