UIPauseView.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import auto_pauseView from "../../../ui/uidata/Interface/auto_pauseView";
  2. import UIBase from "../../../framework/ui/UIBase";
  3. import UIHelp from "../../../framework/ui/UIHelp";
  4. import AccountModel from "../../../data/Account/AccountModel";
  5. import gameData from "../../../gameLogic/utrl/gameData";
  6. const { ccclass, menu, property } = cc._decorator;
  7. @ccclass
  8. @menu("UI/Interface/UIPauseView")
  9. export default class UIPauseView extends UIBase {
  10. ui: auto_pauseView = null;
  11. protected static prefabUrl = "Interface/pauseView";
  12. protected static className = "UIPauseView";
  13. onUILoad() {
  14. this.ui = this.node.addComponent(auto_pauseView);
  15. }
  16. onShow() {
  17. this.initView();
  18. }
  19. initView() {
  20. let diePeopleNum = gameData.peopleDieNum;
  21. this.ui.liveDay_lb.getComponent(cc.Label).string = gameData.curDay.toString();
  22. this.ui.livePeople_lb.getComponent(cc.Label).string = gameData.curPeopleNum.toString();
  23. this.ui.diePeople_lb.getComponent(cc.Label).string = diePeopleNum.toString();
  24. this.ui.dieZom_lb.getComponent(cc.Label).string = gameData.curKillZomNum.toString();
  25. }
  26. continue_btn() {
  27. cc.director.resume();
  28. this.onClose();
  29. }
  30. onStart() {
  31. }
  32. onClose() {
  33. UIHelp.CloseUI(UIPauseView);
  34. }
  35. }