RedPackeWithdrawalViewComp.ts 740 B

1234567891011121314151617181920
  1. import { _decorator } from "cc";
  2. import { ecs } from "db://oops-framework/libs/ecs/ECS";
  3. import { CCComp } from "db://oops-framework/module/common/CCComp";
  4. const { ccclass, property } = _decorator;
  5. /** 视图层对象 */
  6. @ccclass('RedEnvelopeWithdrawalViewComp')
  7. @ecs.register('RedEnvelopeWithdrawalView', false)
  8. export class RedEnvelopeWithdrawalViewComp extends CCComp {
  9. /** 视图层逻辑代码分离演示 */
  10. start() {
  11. // const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
  12. }
  13. /** 视图对象通过 ecs.Entity.remove(RedEnvelopeWithdrawalViewComp) 删除组件是触发组件处理自定义释放逻辑 */
  14. reset() {
  15. this.node.destroy();
  16. }
  17. }