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) {
|
export default class Spawner extends decorate(Trait) {
|
||||||
|
|
||||||
static behaviorTypes() {
|
static behaviorTypes() {
|
||||||
|
const spawnKeys = (entity) => Object.keys(entity.traitInstance('spawner').params.spawns)
|
||||||
|
.reduce((r, key) => ({...r, [key]: key}), {})
|
||||||
return {
|
return {
|
||||||
killAllChildren: {
|
killAllChildren: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
|
@ -26,6 +28,7 @@ export default class Spawner extends decorate(Trait) {
|
||||||
args: [
|
args: [
|
||||||
['key', {
|
['key', {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
options: spawnKeys,
|
||||||
}],
|
}],
|
||||||
['json', {
|
['json', {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
@ -39,6 +42,7 @@ export default class Spawner extends decorate(Trait) {
|
||||||
args: [
|
args: [
|
||||||
['key', {
|
['key', {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
options: spawnKeys,
|
||||||
}],
|
}],
|
||||||
['position', {
|
['position', {
|
||||||
type: 'vector',
|
type: 'vector',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user