Main.ts 653 B

1234567891011121314151617181920212223242526272829303132
  1. const { ccclass, property } = cc._decorator;
  2. @ccclass
  3. export default class Main extends cc.Component {
  4. @property({
  5. type: cc.Asset,
  6. })
  7. mainfestUrl: cc.Asset = null;
  8. start() {
  9. console.log("init");
  10. mk.ui.openPanel("module/login/login");
  11. let a = this.testnew()
  12. }
  13. async testnew() {
  14. let aa = '11111111 '
  15. aa = await this.test();
  16. console.log(aa);
  17. setTimeout(() => {
  18. console.log(aa)
  19. }, 5000)
  20. }
  21. async test() {
  22. let aa = '2222222222'
  23. await mk.time.WaitForSeconds(1);
  24. return aa;
  25. }
  26. }