Home > @esengine/ecs-framework-monorepo > Entity > forEachChild
Entity.forEachChild() method
遍历所有子实体(深度优先)
Signature:
typescript
forEachChild(callback: (child: Entity, index: number) => void, recursive?: boolean): void;
Parameters
Parameter | Type | Description |
---|---|---|
callback | (child: Entity, index: number) => void | 对每个子实体执行的回调函数 |
recursive | boolean | (Optional) 是否递归遍历 |
Returns:
void