definePrefab
definePrefab<
Options>(name,options?):Prefab<Options>
Declares one kind of entity under name, at module scope in a module
the room and every page import: <Entity prefab={wolf} /> places one in
a scene, and spawn(step, wolf, { position }) makes more from a
system. Throws for a name another prefab holds, and for a trait record
holding a value a spawn cannot copy, naming the trait and the field.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Options extends PrefabOptions |
object |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
options |
Options |
Returns
Section titled “Returns”Prefab<Options>