SysData.ts 434 B

12345678910111213141516171819202122
  1. import Main from "../../main/Main";
  2. import SManage from "./sdata/SManage";
  3. /**
  4. * 读取系统数据
  5. */
  6. const {ccclass, property} = cc._decorator;
  7. @ccclass
  8. export default class SysData extends cc.Component {
  9. @property(cc.JsonAsset)
  10. jsonAsset: cc.JsonAsset = null;
  11. onLoad () {
  12. let main = this.node.getComponent(Main);
  13. let data = this.jsonAsset.json;
  14. main.sManage = new SManage(data);
  15. }
  16. }