diff --git a/assets/libs/ecs/ECS.ts b/assets/libs/ecs/ECS.ts index 28fa3b6..1a0c0e7 100644 --- a/assets/libs/ecs/ECS.ts +++ b/assets/libs/ecs/ECS.ts @@ -187,8 +187,6 @@ export namespace ecs { entity.isValid = true; entity.init(); } - else - console.error(`${ctor.name} 实体缺少 init 方法初始化默认组件`); ECSModel.eid2Entity.set(entity.eid, entity); return entity as T; diff --git a/assets/module/common/CCEntity.ts b/assets/module/common/CCEntity.ts index 9a16941..11ea2c4 100644 --- a/assets/module/common/CCEntity.ts +++ b/assets/module/common/CCEntity.ts @@ -17,7 +17,7 @@ type ECSCtor = | __private.__types_globals__AbstractedConstructor; type ECSView = CCView; type EntityCtor = new (...args: any[]) => T; -type BusinessCtor = CCBusiness> = new () => T; +type BusinessCtor = CCBusiness> = new (...args: any[]) => T; /** ECS 游戏模块实体 */ export abstract class CCEntity extends ecs.Entity { @@ -135,8 +135,7 @@ export abstract class CCEntity extends ecs.Entity { if (params == null) { params = { preload: true }; - } - else { + } else { params.preload = true; }