edit: -> нашел причину моей проблемы https://github.com/aframevr/aframe/issues/3297 нужно исправить это
('У меня странная проблема. У меня две сцены. Когда я нажимаю кнопку, вы переключаетесь надругая сцена, и есть еще одна кнопка, которая возвращает вас к первой сцене. Я активирую кнопку с помощью щелчка по ней или обозревателя (фьюзер). Теперь моя проблема: когда я смотрю на кнопку 1 и изменить сцену, а затем нажмите накнопка 2, чтобы вернуться, кнопка 1 уже сработала (поэтому она снова меняет сцену). Если я просто смотрю на кнопки или просто нажимаю на них, все работает нормально, только когда я смотрю что-то, и после этого щелчок не срабатывает.код: ')
<!-----scene1------------------------------>
<a-entity id="browser_scene" visible="true">
<a-entity id="scene1" visible="true">
<!--Icons-->
<a-image id="introid" src="#introicon" position="-20 12 -13" width="9" height="9" rotation="0 75 0" transparent="true" onclick="playscene2()" event-set__enter="_event: mouseenter; color: #33ccff"
event-set__leave="_event: mouseleave; color: #00000"></a-image>
</a-entity>
<!-----scene2------------------------------->
<a-entity id="scene2" visible="false">
<!--Videosphere (intro)-->
<a-videosphere src="#intro"></a-videosphere>
<!--Icons-->
<a-image id="haus" src="#home" position="-5 -6 -1.75" width="2" height="2" rotation="35 -90 -180" transparent="true" onclick="playscene1()" event-set__enter="_event: mouseenter; color: #33ccff"
event-set__leave="_event: mouseleave; color: #00000"></a-image>
</a-entity>
function playscene1() {
document.getElementById('scene1').setAttribute('visible', 'true')
document.getElementById('scene2').setAttribute('visible', 'false')
document.getElementById('haus').setAttribute('visible', 'false')
var videoEl_1 = document.querySelector('#intro');
skyon()
document.querySelector('#intro').pause();
document.querySelector('#intro').currentTime = 0;
}
</script>
function playscene2() {
document.getElementById('scene1').setAttribute('visible', 'false')
document.getElementById('scene2').setAttribute('visible', 'true')
document.getElementById('haus').setAttribute('visible', 'true')
var videoEl_1 = document.querySelector('#intro');
document.querySelector('#intro').pause();
document.querySelector('#intro').currentTime = 0;
skyout()
videoEl_1.play();
document.getElementById('intro').addEventListener('ended',myHandler_1,false);
function myHandler_1(e) {
if(!e) { e = window.event; }
playscene3()
}
}
</script>
<!--camera-->
<a-entity foo rotation="0 90 0">
<a-camera user-height="0" look-controls>
<a-cursor fuse="true" fusetimeout="2000"
position="0 0 -0.1"
geometry="primitive: ring;
radiusInner: 0.002;
radiusOuter: 0.003"
material="color: red; shader: flat">
<a-animation attribute="scale"
to="3 3 3"
dur="2000"
begin="cursor-fusing"
fill="backwards"
easing="linear">
</a-animation>
</a-cursor>
<a-entity id="redcircle" position="0 0 -0.1"
geometry="primitive: ring;
radiusInner: 0.007;
radiusOuter: 0.0077"
material="color: red; opacity: 0.25; shader: flat"></a-entity>
</a-camera>
</a-entity>