app.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Learn cc.Class:
  2. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
  3. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
  4. // Learn Attribute:
  5. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
  6. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
  7. // Learn life-cycle callbacks:
  8. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
  9. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
  10. class App
  11. {
  12. constructor(){
  13. logger.log('constructor');
  14. cc.wangronghui.navigator = require('Navigator').getNavigator();
  15. logger.log('constructor end');
  16. }
  17. }
  18. /**
  19. * 当前环境设置为wangronghui
  20. */
  21. cc.wangronghui = cc.wangronghui || {};
  22. /**
  23. * 由于Logger可能很早使用,在外面初始化吧
  24. */
  25. cc.wangronghui.Log = cc.wangronghui.Log || require('Logger');
  26. const logger = cc.wangronghui.Log.getLogger('App.js');
  27. /**
  28. * 保存下app
  29. */
  30. cc.wangronghui.app = cc.wangronghui.app || new App();