Skip to content

Home > @esengine/ecs-framework-monorepo > ECSFluentAPI

ECSFluentAPI class

ECS流式API主入口 提供统一的流式接口

Signature:

typescript
export declare class ECSFluentAPI

Constructors

Constructor

Modifiers

Description

(constructor)(scene, querySystem, eventSystem)

Constructs a new instance of the ECSFluentAPI class

Methods

Method

Modifiers

Description

batch(entities)

批量操作实体

createComponent(componentClass, args)

创建组件构建器

createEntity()

创建实体构建器

createScene()

创建场景构建器

emit(eventType, event)

触发事件

emitAsync(eventType, event)

异步触发事件

find(componentTypes)

查找实体(简化版)

findByName(name)

按名称查找实体

findByTag(tag)

按标签查找实体

findFirst(componentTypes)

查找第一个匹配的实体

getStats()

获取场景统计信息

off(eventType, listenerId)

移除事件监听器

on(eventType, handler)

监听事件

once(eventType, handler)

一次性监听事件

query()

创建查询构建器

基于 MIT 许可证发布