eliminateViewComp.ts 960 B

123456789101112131415161718192021222324252627282930313233343536373839
  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-20 15:14:13
  6. * @Description: 消除游戏主场景
  7. */
  8. import { _decorator } from "cc";
  9. import { ecs } from "db://oops-framework/libs/ecs/ECS";
  10. import { CCComp } from "db://oops-framework/module/common/CCComp";
  11. const { ccclass, property } = _decorator;
  12. /** 视图层对象 */
  13. @ccclass('eliminateViewComp')
  14. @ecs.register('eliminateView', false)
  15. export class eliminateViewComp extends CCComp {
  16. /** 视图层逻辑代码分离演示 */
  17. start() {
  18. // const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
  19. this.setButton();
  20. }
  21. /** 视图对象通过 ecs.Entity.remove(eliminateViewComp) 删除组件是触发组件处理自定义释放逻辑 */
  22. reset() {
  23. this.node.destroy();
  24. }
  25. private btn_setting() {
  26. }
  27. }