合併元件屬性

如果由多個 mixin 和/或實體定義,則多屬性元件的屬性將合併。例如:

<a-scene>
  <a-assets>
    <a-mixin id="box" geometry="primitive: box"></a-mixin>
    <a-mixin id="tall" geometry="height: 10"></a-mixin>
    <a-mixin id="wide" geometry="width: 10"></a-mixin>
  </a-assets>
  <a-entity mixin="wide tall box" geometry="depth: 2"></a-entity>
</a-scene>

所有幾何元件屬性都將合併,因為它們作為 mixins 包含在實體中並定義。該實體將等同於:

<a-entity geometry="primitive: box; height: 10; depth: 2; width: 10"></a-entity>