MainScene.js 830 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Socket from "../base/Socket";
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. loadLayer: cc.Node,
  6. loginLayer: cc.Node,
  7. labVersion: cc.Label,
  8. },
  9. // LIFE-CYCLE CALLBACKS:
  10. onLoad () {
  11. window.netSocket = new Socket();
  12. },
  13. start () {
  14. this.labVersion.string = AppSettings.Version;
  15. AppSettings.init();
  16. // AppSettings.initClientConfig();
  17. this.goLoadlayer();
  18. },
  19. //检测更新
  20. goLoadlayer(){
  21. this.loadLayer.active = true;
  22. this.loginLayer.active = false;
  23. this.loadLayer.getComponent('LoadLayer').initData();
  24. },
  25. goLoginLayer(){
  26. this.loadLayer.active = false;
  27. this.loginLayer.active = true;
  28. this.loginLayer.getComponent('LoginLayer').initData();
  29. },
  30. });