【发布时间】:2017-12-23 03:47:20
【问题描述】:
我有一个 A-Frame 项目,其中包含多个可引导音频源播放的交互式按钮。
问题是用户可能会不小心双击按钮,然后音频会在原声之后再次播放。
用户还可以在原件仍在播放时单击其他按钮并播放不同的音频。
解决这些问题的最佳方法是什么?
谢谢!
<!--Teleportation-->
<a-entity position="-1.72 1.06 -2.57" class="teleport">
<a-box color="white" depth=".1" height=".1" width="0.3" color="white" rotation="-30 0 0" position="0 -.08 -.2">
<a-entity text="align: center; color:black;value: Teleport" position="-.02 0 0.05"></a-entity>
</a-box>
<a-cylinder position="0 -.17 0" color="yellow" height=".2" radius=".1"
sound__1="on: mouseenter; src: #teleportation-script;"
sound__2="on: click; src: #teleportation-script;"></a-cylinder>
</a-entity>
<!--Hyperdrive-->
<a-entity position="1.72 1.06 -2.57" class="hyperdrive">
<a-box color="white" depth=".1" height=".1" width="0.3" color="white" rotation="-30 0 0" position="0 -.08 -.2">
<a-entity text="align: center; color:black;value: Hyperdrive" position="-.02 0 0.05"></a-entity>
</a-box>
<a-entity gltf-model-next="#button" scale=".2 .2 .2" position="0 -.08 0"
sound__1="on: mouseenter; src: #hyperdrive-script;"
sound__2="on: click; src: #hyperdrive-script;">
</a-entity>
</a-entity>
<!--Comms-->
<a-entity position="-1.4 1.06 -1.6" class="comms">
<a-box color="white" depth=".1" height=".1" width="0.3" color="white" rotation="-30 0 0" position="0 -.08 -.2">
<a-entity text="align: center; color:black;value: Comms" position="-.02 0 0.05"></a-entity>
</a-box>
<a-entity gltf-model-next="#comms" scale=".05 .05 .05" rotation="0 45 0" position="0 -0.1 0.05"
sound__1="on: mouseenter; src: #comms-script;"
sound__2="on: click; src: #comms-script;"></a-entity>
</a-entity>
<!--Planetary Information-->
<a-entity position="-1.0 1.06 -2.07" class="planet">
<a-box color="white" depth=".1" height=".1" width="0.3" color="white" rotation="-30 0 0" position="0 -.08 -.2">
<a-entity text="align: center; color:black;value: Planet Info" position="-.02 0 0.05"></a-entity>
</a-box>
<a-triangle scale=".2 .2 .2" rotation="-90 0 0" color="orange" position="0.1 -.08 .10"
sound__1="on: mouseenter; src: #planet-info-script;"
sound__2="on: click; src: #planet-info-script;"></a-triangle>
</a-entity>
<!--Lasers-->
<a-entity position="1.4 1.06 -1.6" class='lasers'>
<a-sphere radius=".1" position="0 -.15 0" color="red"
sound__1="on: mouseenter; src: #lasers-script;"
sound__2="on: click; src: #lasers-script;"></a-sphere>
<a-box color="white" depth=".1" height=".1" width="0.3" color="white" rotation="-30 0 0" position="0 -.08 -.2">
<a-entity text="align: center; color:black;value: Lasers" position="-.02 0 0.05"></a-entity>
</a-box>
</a-entity>
【问题讨论】: