| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| // Initialize dependencies first | ||
| this.initComponentDependencies(componentName); | ||
|
|
||
| // If component is sceneOnly check the entity is the scene element |
There was a problem hiding this comment.
Wonder if it would be better to add this logic in the component constructor. Also the multiplicity check below. to keep things tidier here
Sorry, something went wrong.
There was a problem hiding this comment.
The component does have all the information needed to perform these checks, so I moved the checks. Inside component.js is now also the only place the sceneOnly and multiple flag are read, which is nice.
Sorry, something went wrong.
|
Thank you! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description:
There are a couple of components intended to be used on <a-scene> exclusively. These reside in src/components/scene, but little prevents people from (accidentally) using them on other entities. Only the fog component performed a check that it was applied to the scene.
Instead of adding similar checks to all these components, this PR introduces a sceneOnly flag that components can set in their definition. Similar to the multiple flag this will throw when a sceneOnly component is being added to an entity that isn't the scene.
Changes proposed: