feat(hero): 添加英雄属性事件处理系统及组件
添加 HeroAttrEvent 组件用于存储属性变更事件队列 添加 HeroAttrEventSystem 系统用于处理属性变更事件并更新角色属性
This commit is contained in:
29
assets/script/game/hero/HeroAttrEvent.ts
Normal file
29
assets/script/game/hero/HeroAttrEvent.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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 = [];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user