EliminateViewComp.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-20 15:01:09
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-03-21 17:33:24
  6. * @Description: 消除游戏主场景
  7. */
  8. import { _decorator } from "cc";
  9. import { oops } from "db://oops-framework/core/Oops";
  10. import { ecs } from "db://oops-framework/libs/ecs/ECS";
  11. import { CCComp } from "db://oops-framework/module/common/CCComp";
  12. import { UIID } from "../../common/config/GameUIConfig";
  13. const { ccclass, property } = _decorator;
  14. /** 视图层对象 */
  15. @ccclass('EliminateViewComp')
  16. @ecs.register('EliminateView', false)
  17. export class EliminateViewComp extends CCComp {
  18. /** 视图层逻辑代码分离演示 */
  19. start() {
  20. // const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
  21. this.setButton();
  22. }
  23. /** 视图对象通过 ecs.Entity.remove(eliminateViewComp) 删除组件是触发组件处理自定义释放逻辑 */
  24. reset() {
  25. this.node.destroy();
  26. }
  27. private btn_setting() {
  28. oops.gui.open(UIID.Setting);
  29. }
  30. private btn_withdraw() {
  31. oops.gui.open(UIID.WechatWithdraw);
  32. }
  33. }