Handle __mhc_link_type for nodes

fixes video-texture-target
This commit is contained in:
netpro2k 2021-10-12 18:07:27 -07:00
Родитель ff546df26e
Коммит abcd17f931
1 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -1995,7 +1995,20 @@ class GLTFLoader {
const components = getComponents(object);
for (const [componentName, componentProps] of Object.entries(components)) {
for (const [propName, propValue] of Object.entries(componentProps)) {
if (
const type = propValue && propValue.__mhc_link_type;
if (type && propValue.index !== undefined) {
// TODO support other types
if (type === "node") {
this.getDependency(type, propValue.index).then(node => {
node.userData.MOZ_spoke_uuid = node.uuid;
componentProps[propName] = { __gltfIndexForUUID: node.uuid };
});
} else {
console.warn(
`Spoke currently only supports "node" component references. This component ${componentName} is using a ${type} ref for ${propName}`
);
}
} else if (
HUBS_NODEREF_COMPONENTS[componentName] &&
HUBS_NODEREF_COMPONENTS[componentName].indexOf(propName) !== -1
) {