Skip to content

Home > @esengine/ecs-framework-monorepo > EntityManager > getEntityByName

EntityManager.getEntityByName() method

根据名称获取实体

如果存在多个同名实体,返回第一个找到的实体。

Signature:

typescript
getEntityByName(name: string): Entity | null;

Parameters

Parameter

Type

Description

name

string

实体名称

Returns:

Entity | null

匹配的实体,如果不存在则返回null

基于 MIT 许可证发布