aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
647 stars 198 forks source link

Add functions to emit and listen events of inspector #718

Closed gregogalante closed 4 weeks ago

gregogalante commented 4 weeks ago

Sometimes we need to manage inspector functionalities from the outside. We can access with AFRAME.INSPECTOR but some operations can not be done with the Inspector class instance.

With this mode we can listen and emit events using AFRAME.INSPECTOR.

vincentfretin commented 4 weeks ago

There is already https://github.com/aframevr/aframe-inspector/blob/575c9106e26b41c714cc369b55c4db861315d7a0/src/index.js#L20 exposed We can just add this.off = Events.off; instead of using two other functions. Please don't include the dist in the PR.

vincentfretin commented 4 weeks ago

Ah and this.emit = Events.emit of course.

gregogalante commented 4 weeks ago

@vincentfretin this.emit = Events.emit is not existing. I create a new pull request

vincentfretin commented 4 weeks ago

Yeah this is what I meant, change your PR to expose off and emit.