【发布时间】:2021-01-14 10:05:01
【问题描述】:
我有点 Dev noonb,但我想在 AR 应用程序中创建一个流程,允许我显示/延迟/隐藏/显示行为类型。
我正在使用 aframe 作为平台,所以现在尝试设计它。
体验将包括 5 个场景,其中显示多个资产,然后在播放一些动画后隐藏。
我尝试在场景级别更改可见 =true/false,但添加额外场景后第 8 面墙未加载。
创建一个函数来控制实体级别的取消隐藏是最好的方法吗?任何帮助将不胜感激。
这是我目前所拥有的
<a-entity
id="model"
gltf-model="#animatedModel"
class="cantap"
scale="55 55 55"
animation-mixer="clip: FLOAT"
xrextras-hold-drag
xrextras-two-finger-rotate
xrextras-pinch-scale
shadow
visible="true">
</a-entity>
目前它由按钮控制,但我希望它在 x 秒后自动发生
const nextButtonComponent = () => ({
init() {
const visibilityList = ['text', 'sun']
const model = document.getElementById('model')
const sunmodel = document.getElementById('sunmodel')
const nextButton = document.getElementById('nextbutton')
nextButton.style.display = 'block'
const nextAnimation = () => {
model.setAttribute('visible', false)
sunmodel.setAttribute('visible', true)
}
nextButton.onclick = nextAnimation // Switch to the next animation when the button is pressed.
},
})
export {nextButtonComponent}
【问题讨论】:
标签: javascript aframe 8thwall-xr