UI_Hall.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { _decorator, Button, Component, Node } from 'cc';
  2. import { Layout_Hall } from './Layout_Hall';
  3. import { UI_Rank } from '../UI_Rank/UI_Rank';
  4. import { UI_Settings } from '../UI_Settings/UI_Settings';
  5. import { UI_Sign } from '../UI_Sign/UI_Sign';
  6. import { UI_Invite } from '../UI_Invite/UI_Invite';
  7. import { GameUILayers, gui } from '../../../core/ui/ui';
  8. import ui_base from '../../../core/ui/ui_base';
  9. import { ResUtil } from '../../../core/util/ResUtil';
  10. import { ModuleDef } from '../../../Scripts/ModuleDef';
  11. import { SceneDef } from '../../../Scripts/SceneDef';
  12. const { ccclass, property } = _decorator;
  13. @ccclass('UI_Hall')
  14. export class UI_Hall extends ui_base {
  15. constructor() {
  16. super(ModuleDef.GAME, 'ui/UI_Hall/Hall', GameUILayers.GAME, Layout_Hall);
  17. }
  18. protected async onCreated() {
  19. const layout = this.getLayout<Layout_Hall>();
  20. this.onButtonEvent(layout.Start_Btn, () => {
  21. ResUtil.loadScene(SceneDef.GAME, ModuleDef.GAME, true);
  22. gui.close(UI_Hall);
  23. });
  24. this.onButtonEvent(layout.Settings_Btn, () => {
  25. gui.show(UI_Settings);
  26. });
  27. this.onButtonEvent(layout.Rank_Btn, () => {
  28. gui.show(UI_Rank);
  29. });
  30. this.onButtonEvent(layout.Sign_Btn, () => {
  31. gui.show(UI_Sign);
  32. });
  33. this.onButtonEvent(layout.Invite_Btn, () => {
  34. gui.show(UI_Invite);
  35. })
  36. }
  37. update(deltaTime: number) {
  38. }
  39. }