Files
pixelheros/assets/script/game/hero/HeroAttrEvent.ts
panw bb0ed6a9c3 refactor(hero): 重命名属性事件队列并添加添加方法
将 HeroAttrEvent 类中的 AttrEvent 属性重命名为 AttrEvents 以更符合命名规范
添加 addAttrEvent 方法以封装事件添加逻辑
移除不必要的注释以保持代码简洁
2025-12-31 14:16:44 +08:00

20 lines
456 B
TypeScript

import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { Attrs } from "../common/config/HeroAttrs";
export interface AttrEvent {
Attr: Attrs;
Value:number;
}
@ecs.register('HeroAttrEvent')
export class HeroAttrEvent extends ecs.Comp {
AttrEvents:AttrEvent[] = [];
addAttrEvent(event:AttrEvent){
this.AttrEvents.push(event);
}
reset() {
this.AttrEvents = [];
}
}