mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 01:01:09 +08:00
优化CCEntity语法
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -17,7 +17,7 @@ type ECSCtor<T extends ecs.Comp> =
|
||||
| __private.__types_globals__AbstractedConstructor<T>;
|
||||
type ECSView = CCView<CCEntity>;
|
||||
type EntityCtor<T extends CCEntity = CCEntity> = new (...args: any[]) => T;
|
||||
type BusinessCtor<T extends CCBusiness<CCEntity> = CCBusiness<CCEntity>> = new () => T;
|
||||
type BusinessCtor<T extends CCBusiness<CCEntity> = CCBusiness<CCEntity>> = 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user