LobbyScene.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { _decorator, assetManager, Component, Label, sys } from 'cc';
  2. import { SceneDef } from '../../scripts/SceneDef';
  3. import { UserMgr } from './UserMgr';
  4. import { GameSceneUtil } from './GameSceneUtil';
  5. import { UIAnnouncement } from '../ui_announcement/UIAnnouncement';
  6. import { UITeam } from '../ui_team/UITeam';
  7. import { lobbyNet } from './NetGameServer';
  8. import { UIChat } from '../ui_chat/UIChat';
  9. const { ccclass, property } = _decorator;
  10. @ccclass('LobbyScene')
  11. export class LobbyScene extends Component {
  12. @property(Label) lblName: Label = null;
  13. async start() {
  14. // if (!UserMgr.inst.uid) {
  15. // tgx.SceneUtil.loadScene(SceneDef.START);
  16. // return;
  17. // }
  18. GameSceneUtil.inst.exitGame();
  19. tgx.UIMgr.inst.closeAll();
  20. tgx.UIMgr.inst.showUI(UIAnnouncement)
  21. this.lblName.string = UserMgr.inst.getRandomName();
  22. if(lobbyNet.type != 'http'){
  23. tgx.UIMgr.inst.showUI(UIChat,null,null,lobbyNet);
  24. }
  25. }
  26. onBtnRandomNameClicked() {
  27. this.lblName.string = UserMgr.inst.getRandomName(true);
  28. }
  29. onBtnAvatarClicked() {
  30. tgx.UIAlert.show('暂无可用皮肤');
  31. }
  32. onBtnMatchClicked() {
  33. tgx.UIMgr.inst.showUI(UITeam);
  34. }
  35. update(deltaTime: number) {
  36. }
  37. }