From 60c73bcc5ccd52ecd682bf99b20f075406d3691c Mon Sep 17 00:00:00 2001 From: netpro2k Date: Tue, 21 Sep 2021 19:08:04 -0700 Subject: [PATCH] Migrate background to environment-settings fixes #4648 --- src/gltf-component-mappings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gltf-component-mappings.js b/src/gltf-component-mappings.js index 22e2f3b91a..6053d286f7 100644 --- a/src/gltf-component-mappings.js +++ b/src/gltf-component-mappings.js @@ -23,7 +23,6 @@ function registerRootSceneComponent(componentName) { } registerRootSceneComponent("fog"); -registerRootSceneComponent("background"); AFRAME.GLTFModelPlus.registerComponent("duck", "duck", el => { el.setAttribute("duck", ""); @@ -599,6 +598,14 @@ AFRAME.GLTFModelPlus.registerComponent("audio-zone", "audio-zone", (el, componen el.setAttribute(componentName, { ...componentData }); }); +AFRAME.GLTFModelPlus.registerComponent("background", "background", (el, _componentName, componentData) => { + console.warn( + "The `background` component is deprecated, use `backgroundColor` on the `environment-settings` component instead." + ); + // This assumes the background component is on the root entity, which it is for spoke, the only thing using this component + el.setAttribute("environment-settings", { backgroundColor: new THREE.Color(componentData.color) }); +}); + AFRAME.GLTFModelPlus.registerComponent( "environment-settings", "environment-settings",