跳转到内容

defineResource

此内容尚不支持你的语言。

defineResource<T>(defaultValue, name?): ResourceDef<T>

Defined in: ecs/resource.ts:55

Declare a resource: one value the whole world shares. A NAMED one is addressed by its name, so two declarations of one name are one resource; an unnamed one is addressed by the definition, and two calls answer two.

An empty slot materialises the LATEST declaration’s defaultValue.

T

T

string

ResourceDef<T>