【发布时间】:2018-02-25 14:22:42
【问题描述】:
所以我正在查看有关组件更新的框架文档
AFRAME.registerComponent('visible', {
/**
* this.el is the entity element.
* this.el.object3D is the three.js object of the entity.
* this.data is the component's property or properties.
*/
update: function (oldData) {
this.el.object3D.visible = this.data;
}
// ...
});
如何使用它来仅更改 1 个属性,同时保持其余属性不变?即改变 x 的值,但保留 y 和 z。当我使用 setAttribute 时,似乎属性只是替换为我传递给 setAttribute 的任何内容。
【问题讨论】:
标签: aframe