Home > @esengine/ecs-framework-monorepo > ECSFluentAPI > on
ECSFluentAPI.on() method
监听事件
Signature:
typescript
on<T>(eventType: string, handler: (event: T) => void): string;
Parameters
Parameter | Type | Description |
---|---|---|
eventType | string | 事件类型 |
handler | (event: T) => void | 事件处理器 |
Returns:
string
监听器ID