倾听子元素被附加和分离
我们可以使用子连接和子连接事件来监听场景附加或分离实体的时间:
entity.addEventListener('child-attached', function (evt) {
if (evt.detail.el.tagName.toLowerCase() === 'a-box') {
console.log('a box element has been attached');
};
});
我们可以使用子连接和子连接事件来监听场景附加或分离实体的时间:
entity.addEventListener('child-attached', function (evt) {
if (evt.detail.el.tagName.toLowerCase() === 'a-box') {
console.log('a box element has been attached');
};
});