场景搜索包含特定组件的实体列表

This commit is contained in:
yhh
2021-03-26 17:36:50 +08:00
parent d2915fe30c
commit 8b5bc444f1
5 changed files with 180 additions and 36 deletions

View File

@@ -224,6 +224,15 @@ module es {
return this.entities.findComponentsOfType<T>(type);
}
/**
* 返回场景中包含特定组件的实体列表
* @param type
* @returns
*/
public findEntitiesOfComponent(...types): Entity[] {
return this.entities.findEntitesOfComponent(...types);
}
/**
* 在场景中添加一个EntitySystem处理器
* @param processor 处理器