From cddf9e142c4ebf2cdbb90d4381d1920433cdc675 Mon Sep 17 00:00:00 2001 From: dgflash Date: Sat, 10 Jan 2026 13:04:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96CCEntity=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/ecs/ECS.ts | 2 -- assets/module/common/CCEntity.ts | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) 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; }