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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”defaultValue
Section titled “defaultValue”T
string
Returns
Section titled “Returns”ResourceDef<T>