EntityCommands
此内容尚不支持你的语言。
Defined in: ecs/commands.ts:100
One entity’s share of a CommandsInstance: chain insert/remove and
let the queue apply them. Asking EntityCommands.id for a spawn’s
entity materialises it early, because an id has to exist to be answered.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new EntityCommands(
commands,entity,name?):EntityCommands
Defined in: ecs/commands.ts:108
Parameters
Section titled “Parameters”commands
Section titled “commands”entity
Section titled “entity”number | null
string
Returns
Section titled “Returns”EntityCommands
Methods
Section titled “Methods”childOf()
Section titled “childOf()”childOf(
parent):this
Defined in: ecs/commands.ts:151
Attach this entity under parent. The engine keeps Parent and
Children in step from here — inserting Parent yourself writes
only one half of the link.
Parameters
Section titled “Parameters”parent
Section titled “parent”number
Returns
Section titled “Returns”this
finalize()
Section titled “finalize()”finalize():
void
Defined in: ecs/commands.ts:167
Returns
Section titled “Returns”void
id():
number
Defined in: ecs/commands.ts:160
Returns
Section titled “Returns”number
insert()
Section titled “insert()”insert<
T>(component,data?):this
Defined in: ecs/commands.ts:121
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”component
Section titled “component”Partial<T>
Returns
Section titled “Returns”this
remove()
Section titled “remove()”remove(
component):this
Defined in: ecs/commands.ts:139
Parameters
Section titled “Parameters”component
Section titled “component”Returns
Section titled “Returns”this