36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { _decorator, Component } from 'cc';
|
|
import { tgxUIMgr, tgxSceneUtil, tgxAudioMgr } from '../../core_tgx/tgx';
|
|
import { SceneDef } from '../../scripts/SceneDef';
|
|
import { UserMgr } from './UserMgr';
|
|
import { SubGameMgr } from './SubGameMgr';
|
|
// import { UIAnnouncement } from 'db://assets/module_arean/ui_announcement/UIAnnouncement';
|
|
import { EMusicDefine } from './MusicDefine';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('LobbyScene')
|
|
export class LobbyScene extends Component {
|
|
async start() {
|
|
if (!UserMgr.inst.userId) {
|
|
tgxSceneUtil.loadScene(SceneDef.START);
|
|
return;
|
|
}
|
|
|
|
SubGameMgr.inst.exitSubGame();
|
|
|
|
tgxUIMgr.inst.closeAll();
|
|
|
|
// tgxUIMgr.inst.showUI(UIAnnouncement)
|
|
// tgxUIMgr.inst.showUI(UIChat);
|
|
}
|
|
|
|
onBtnSubGameClicked(event, gameType: string) {
|
|
tgxAudioMgr.inst.playCommonBtn(EMusicDefine.EFFECT_CLICK);
|
|
if (gameType == 'billiards' || gameType == 'gomoku' || gameType == 'tank' ||gameType == 'kingtd' || gameType == 'arean') {
|
|
SubGameMgr.inst.enterSubLobby(gameType);
|
|
}
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
} |