GameOverView.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-27 18:19:53
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-14 16:38:45
  6. * @Description: 游戏结束界面
  7. */
  8. import { _decorator } from 'cc';
  9. import { oops } from 'db://oops-framework/core/Oops';
  10. import { GameComponent } from "db://oops-framework/module/common/GameComponent";
  11. import { UIID } from '../common/config/GameUIConfig';
  12. import { GameEvent } from '../common/config/GameEvent';
  13. import { smc } from '../common/SingletonModuleComp';
  14. import { ADHandler } from '../common/manager/ADHandler';
  15. import { AD_TYPE } from '../common/config/GameDefine';
  16. import { ServerHandler } from '../common/manager/ServerHandler';
  17. const { ccclass, property } = _decorator;
  18. /** 显示对象控制 */
  19. @ccclass('GameOverView')
  20. export class GameOverView extends GameComponent {
  21. protected start() {
  22. this.setButton();
  23. }
  24. private btn_restart() {
  25. // oops.message.dispatchEvent(GameEvent.RestartGame);
  26. ServerHandler.inst.RestartGame();
  27. oops.gui.remove(UIID.GameOver);
  28. }
  29. private btn_resurrection() {
  30. //打开广告
  31. //我这调你登录,你登录后,返回给我,可以登录,我这边加载资源,userinfo-头像,UID nickname,关卡,还有配置,
  32. //复活
  33. smc.game.GameModel.viewType = "revive_reward";
  34. //复活 分数不清零
  35. ADHandler.inst.showAd(AD_TYPE.Resurrection);
  36. oops.gui.remove(UIID.GameOver);
  37. oops.message.dispatchEvent(GameEvent.Resurrection);
  38. }
  39. }