diff --git a/packages/physics/src/traits/emitter.js b/packages/physics/src/traits/emitter.js index 484f833..4a3bfc5 100644 --- a/packages/physics/src/traits/emitter.js +++ b/packages/physics/src/traits/emitter.js @@ -37,57 +37,51 @@ export default (latus) => class Emitter extends decorate(Trait) { this.#emitter.addEventListener('PARTICLE_UPDATE', this.#onParticleUpdate); } - static behaviorTypes() { - return { - emitParticleEntity: { - cycle: true, - type: 'entity', - label: 'Create particle.', - args: [ - ['entity', { - type: 'entity', - }], - ], - }, - emitParticleJson: { - type: 'stream', - label: 'Create particle.', - args: [ - ['json', { - type: 'object', - }], - ], - }, - emitParticle: { - type: 'stream', - label: 'Create particle.', - args: [ - ['key', { - type: 'string', - options: (entity) => ( - Object.keys(entity.trait('Emitter').particles) - .reduce((r, key) => ({...r, [key]: key}), {}) - ), - }], - ['json', { - type: 'object', - }], - ], - }, - }; - } - static defaultParams() { return { particles: {}, }; } - static describeParams() { + static describe(entity) { return { - particles: { - type: 'object', - label: 'Particles', + emitParticleEntity: { + type: 'entity', + label: 'Create particle.', + args: [ + { + label: 'entity', + type: 'entity', + }, + ], + }, + emitParticleJson: { + type: 'void', + label: 'Create particle.', + args: [ + { + label: 'json', + type: 'object', + }, + ], + }, + emitParticle: { + type: 'void', + label: 'Create particle.', + args: [ + { + label: 'key', + type: 'string', + options: () => ( + Object.keys(entity.trait('Emitter').particles) + .reduce((r, key) => ({...r, [key]: key}), {}) + ), + }, + { + label: 'json', + type: 'object', + }, + ], }, }; }