Unregister the system / unload effects
See original GitHub issueHello, I’m stuck on some silly detail. I have a postprocessing system registered this way.
load().then((assets) => { AFRAME.registerSystem("postprocessing", postprocessingSystem.setAssets(assets)); }).catch(console.error);
The script is called by a component in an A-frame <a-entity>.
I need to remove the component under certain actions and its effects at the same time.
-First problem: postprocessing remains active. -second problem: if I reactivate it for the second time I logically get:
Error: The system
postprocessing has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name. at Object.module.exports.registerSystem (system.js:143) at (index):668
Question: what is the method to return to withdraw the system or the effects?
Thank you in advance, Ludovic
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
I will try this way 😃 thanks you
Hi,
the a-frame example is pretty much just a hacky proof of concept that doesn’t really harmonize with
a-frame
. I don’t think it’s possible to unregister systems in a-frame anymore, but you could add custom enable/disable logic: https://jsfiddle.net/537osy0q/.A proper solution would probably consist of a more integrated post processing System with pass and effect Components.