Files
pixelheros/assets/script/game/hero/HeroAttrEvent.ts
panw 707f8ab1cb feat(hero): 添加英雄属性事件处理系统及组件
添加 HeroAttrEvent 组件用于存储属性变更事件队列
添加 HeroAttrEventSystem 系统用于处理属性变更事件并更新角色属性
2025-12-31 10:56:42 +08:00

29 lines
638 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 {
/** 伤害事件队列 */
AttrEvent: AttrEvent[] = [];
reset() {
this.AttrEvent = [];
}
}