feat: spawn key options
This commit is contained in:
parent
a32159cee9
commit
3628abde5c
|
@ -14,6 +14,8 @@ const decorate = compose(
|
|||
export default class Spawner extends decorate(Trait) {
|
||||
|
||||
static behaviorTypes() {
|
||||
const spawnKeys = (entity) => Object.keys(entity.traitInstance('spawner').params.spawns)
|
||||
.reduce((r, key) => ({...r, [key]: key}), {})
|
||||
return {
|
||||
killAllChildren: {
|
||||
type: 'void',
|
||||
|
@ -26,6 +28,7 @@ export default class Spawner extends decorate(Trait) {
|
|||
args: [
|
||||
['key', {
|
||||
type: 'string',
|
||||
options: spawnKeys,
|
||||
}],
|
||||
['json', {
|
||||
type: 'object',
|
||||
|
@ -39,6 +42,7 @@ export default class Spawner extends decorate(Trait) {
|
|||
args: [
|
||||
['key', {
|
||||
type: 'string',
|
||||
options: spawnKeys,
|
||||
}],
|
||||
['position', {
|
||||
type: 'vector',
|
||||
|
|
Loading…
Reference in New Issue
Block a user