aframe icon indicating copy to clipboard operation
aframe copied to clipboard

Introduce sceneOnly flag for components

Open mrxz opened this issue 1 year ago • 0 comments

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:

  • Introduce sceneOnly flag in property definition
  • Verify that sceneOnly components are only added to <a-scene> otherwise throw an Error

mrxz avatar Feb 15 '24 10:02 mrxz