HallMediator.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { GUIManager } from "../../../engines/gui/GUIManager";
  2. import GUIMediator from "../../../engines/gui/GUIMediator";
  3. import LoadingView from "../../../engines/loadingView/LoadingView";
  4. import SceneManager from "../../../engines/scenes/SceneManager";
  5. import UI_Hall from "../../../ui/Hall/UI_Hall";
  6. import LayerKeys from "../../LayerKeys";
  7. import GameModel from "../../models/GameModel";
  8. import UIKeys from "../../UIKeys";
  9. export default class HallMediator extends GUIMediator
  10. {
  11. protected OnShow():void{
  12. GUIManager.single.Show(UIKeys.WXS01);
  13. this.view.m_levelLabel.text="第"+GameModel.single.currentLevel+"关";
  14. }
  15. protected OnHide():void{
  16. }
  17. protected AddEvents():void{
  18. this.view.m_Start.onClick(this.StartButtonClick,this);
  19. this.view.m_btnMore.onClick(this.MoreButtonClick,this);
  20. }
  21. protected RemoveEvents():void{
  22. this.view.m_Start.offClick(this.StartButtonClick,this);
  23. this.view.m_btnMore.offClick(this.MoreButtonClick,this);
  24. }
  25. private MoreButtonClick():void{
  26. GUIManager.single.Show(UIKeys.WXS01);
  27. }
  28. private StartButtonClick():void{
  29. GUIManager.single.Show(UIKeys.EGG);
  30. this.HideSelf();
  31. }
  32. get view():UI_Hall{
  33. return this._view as UI_Hall;
  34. }
  35. }