Class: EntityManager
Creates and manages entities.
Constructors
Constructor
new EntityManager(): EntityManager;
Returns
EntityManager
Methods
Create()
static Create(name): Promise<number>;
Creates a new entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Human-readable name to assign to the new entity. |
Returns
Promise<number>
A promise that resolves to the newly created Entity handle.
Destroy()
static Destroy(entity): Promise<boolean>;
Destroys an existing entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity handle to remove from the runtime. |
Returns
Promise<boolean>
A promise that resolves to true when the entity was destroyed
successfully, or false when the destroy operation was rejected or failed.
SetActive()
static SetActive(entity, active): Promise<void>;
Sets whether an entity is active.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity handle to update. |
active | boolean | true to activate the entity; false to deactivate it. |
Returns
Promise<void>
A promise that resolves when the active state has been changed.
GetActive()
static GetActive(entity): Promise<boolean>;
Retrieves whether an entity is currently active.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity handle to inspect. |
Returns
Promise<boolean>
A promise that resolves to true if the entity is active, otherwise
false.
SetName()
static SetName(entity, name): Promise<void>;
Set the name of an entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity to rename. |
name | string | The new human-readable name for the entity. |
Returns
Promise<void>
A promise that resolves when the name has been changed.
GetName()
static GetName(entity): Promise<string>;
Gets the name of an entity.
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | number | The Entity whose name should be returned. |
Returns
Promise<string>
A promise that resolves to the entity's current name.