IdeaSpaceVR / aframe-particle-system-component

Particle systems for A-Frame.
https://ideaspacevr.github.io/aframe-particle-system-component/
MIT License
232 stars 68 forks source link

Expose SPE.Emitter.disable() and SPE.Emitter.enable() #21

Open UXVirtual opened 7 years ago

UXVirtual commented 7 years ago

I'd be great to expose the disable() and enable() methods on SPE.Emitter as component methods. Currently I have to do the following if I want to start / stop the emitter:

var particleEntity = document.querySelector('[particle-system]');
particleEntity.components['particle-system'].particleGroup.emitters[0].disable();
particleEntity.components['particle-system'].particleGroup.emitters[0].enable();

Having the above would allow the component to be used more easily for temporary effects such as object collisions / teleport effects etc.

I'm assuming this component only ever creates one particle emitter?

kfarr commented 6 years ago

This issue can be closed? Looks complete with https://github.com/joshmarinacci/aframe-particle-system-component/commit/551488c58c5828fb498ae993c96842750bec6547