【问题标题】:Changing only 1 property of aframe component仅更改框架组件的 1 个属性
【发布时间】: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


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-07
      • 1970-01-01
      相关资源
      最近更新 更多