优化ECSEntity

This commit is contained in:
dgflash
2024-09-29 20:52:20 +08:00
parent 86094edd84
commit 9665f741c5

View File

@@ -119,8 +119,6 @@ export class ECSEntity {
* @param isReAdd true-表示用户指定这个实体可能已经存在了该组件那么再次add组件的时候会先移除该组件然后再添加一遍。false-表示不重复添加组件
*/
add<T extends ecs.IComp>(obj: T): ECSEntity;
add(ctor: number, isReAdd?: boolean): ECSEntity;
add<T extends ecs.IComp>(ctor: CompCtor<T>, isReAdd?: boolean): T;
add<T extends ecs.IComp>(ctor: CompType<T>, isReAdd?: boolean): T;
add<T extends ecs.IComp>(ctor: CompType<T> | T, isReAdd: boolean = false): T | ECSEntity {
if (typeof ctor === 'function') {