Skip to content

Home > @esengine/ecs-framework-monorepo > EntityList > forEachWhere

EntityList.forEachWhere() method

批量操作:对符合条件的实体执行指定操作

Signature:

typescript
forEachWhere(predicate: (entity: Entity) => boolean, action: (entity: Entity) => void): void;

Parameters

Parameter

Type

Description

predicate

(entity: Entity) => boolean

筛选条件

action

(entity: Entity) => void

要执行的操作

Returns:

void

基于 MIT 许可证发布