合并组件属性

如果由多个 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>