注册系统

类似于 aframe 组件注册系统。

如果系统名称与组件名称匹配,则组件将引用系统作为 this.system:

AFRAME.registerSystem('my-component', {
  schema: {},  // System schema. Parses into `this.data`.
  init: function () {
    // Called on scene initialization.
  },
  // Other handlers and methods.
});
AFRAME.registerComponent('my-component', {
  init: function () {
    console.log(this.system);
  }
});