AboutViewComp.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-04-07 17:49:55
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-15 15:35:54
  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 "../config/GameUIConfig";
  13. import { CCVMParentComp } from "db://oops-framework/module/common/CCVMParentComp";
  14. const { ccclass, property } = _decorator;
  15. /** 视图层对象 */
  16. @ccclass('AboutViewComp')
  17. @ecs.register('AboutView', false)
  18. export class aboutViewComp extends CCVMParentComp {
  19. data: any = {
  20. gameName: "",
  21. version: "",
  22. companyName: "",
  23. }
  24. /** 视图层逻辑代码分离演示 */
  25. start() {
  26. // const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
  27. this.setButton();
  28. this.data.gameName = oops.config.game.gameName;
  29. this.data.version = oops.config.game.gameVersion;
  30. this.data.companyName = oops.config.game.gameCompanyName;
  31. }
  32. /** 视图对象通过 ecs.Entity.remove(aboutUsViewComp) 删除组件是触发组件处理自定义释放逻辑 */
  33. reset() {
  34. this.node.destroy();
  35. }
  36. btn_back() {
  37. oops.gui.remove(UIID.AboutUs);
  38. }
  39. }