【发布时间】:2017-01-14 12:58:17
【问题描述】:
如何从 A-Frame 中的组件.init() 函数中获取场景?
AFRAME.registerComponent('foo', {
init: function () {
// ?
}
});
【问题讨论】:
标签: aframe
如何从 A-Frame 中的组件.init() 函数中获取场景?
AFRAME.registerComponent('foo', {
init: function () {
// ?
}
});
【问题讨论】:
标签: aframe
https://aframe.io/docs/0.4.0/core/component.html#component-prototype-properties
AFRAME.registerComponent('foo', {
init: function () {
console.log(this.el.sceneEl);
},
update: function () {
console.log(this.el.sceneEl);
}
});
【讨论】: