Files
heros/assets/script/game/map/EquipsComp.ts

29 lines
857 B
TypeScript

import { _decorator } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { GameEvent } from "../common/config/GameEvent";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('EquipsCompComp')
@ecs.register('EquipsComp', false)
export class EquipsCompComp extends CCComp {
/** 视图层逻辑代码分离演示 */
onLoad() {
this.on(GameEvent.UseSkillCard, this.get_skill, this);
}
update(dt: number): void {
}
get_skill(){
console.log("get_skill")
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}