У меня есть aframe-сцена с двумя стрелками и некоторыми объектами, и я пытаюсь переключаться между объектами, но я не понимаю, как мне нужна помощь, вот что я получил:
AFRAME.registerComponent("fool", {
init: function() {
var boxarray = ["#bluebox, #yellowbox, #greenbox]
boxarray[0] = true;
if(boxarray[0] = true){
document.getElementById('bluebox').setAttribute('visible', 'true');
document.getElementById('bluebox').setAttribute('scale', {x:1,y:1,z:1});
} else {
document.getElementById('bluebox').setAttribute('visible', 'false');
document.getElementById('bluebox').setAttribute('scale', {x:0,y:0,z:0});
}
if(boxarray[1] = true){
document.getElementById('bluebox').setAttribute('visible', 'true');
document.getElementById('bluebox').setAttribute('scale', {x:1,y:1,z:1});
} else {
document.getElementById('bluebox').setAttribute('visible', 'false');
document.getElementById('bluebox').setAttribute('scale', {x:0,y:0,z:0});
}
if(boxarray[2] = true){
document.getElementById('bluebox').setAttribute('visible', 'true');
document.getElementById('bluebox').setAttribute('scale', {x:1,y:1,z:1});
} else {
document.getElementById('bluebox').setAttribute('visible', 'false');
document.getElementById('bluebox').setAttribute('scale', {x:0,y:0,z:0});
}
function toggleright(){
?help?
}
function toggleleft(){
?help?
}
})
Iпопробуй дать всем моим объектам (ящикам) событие, чтобы изменение источника было просто полезно, если событие тоже меняется