refactor(hero): 重构英雄属性系统与受击特效

将HeroAttrSystem从HeroAttrsComp中分离为独立文件
删除废弃的05-outline-glow资源文件
优化TalComp.ts中的代码格式
使用FlashSprite替换旧的受击特效实现
This commit is contained in:
2025-11-15 10:52:39 +08:00
parent a468c6c774
commit 4af9a6fd9e
19 changed files with 144 additions and 620 deletions

View File

@@ -14,6 +14,7 @@ import { Tooltip } from "../skill/Tooltip";
import { timedCom } from "../skill/timedCom";
import { HeroInfo, HType } from "../common/config/heroSet";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { FlashSprite } from "./materials/scripts/FlashSprite";
const { ccclass, property } = _decorator;
@@ -37,6 +38,7 @@ export class HeroViewComp extends CCComp {
// 血条显示相关
hpBarShowTime:number = 5; // 血条显示持续时间(秒)
hpBarShowCD:number = 0; // 血条显示计时器
fsSprite:FlashSprite = null!;
// ==================== UI 节点引用 ====================
private top_node: Node = null!;
@@ -79,7 +81,7 @@ export class HeroViewComp extends CCComp {
// 初始化 UI 节点
this.initUINodes();
/** 方向 */
this.node.setScale(this.scale*this.node.scale.x,1*this.node.scale.y);
this.top_node.setScale(this.scale*this.top_node.scale.x,1*this.top_node.scale.y);
@@ -101,6 +103,7 @@ export class HeroViewComp extends CCComp {
this.top_node = this.node.getChildByName("top");
let hp_y = this.node.getComponent(UITransform).height+10;
this.top_node.setPosition(0, hp_y, 0);
this.fsSprite = this.node.getComponent(FlashSprite);
}
@@ -214,12 +217,13 @@ export class HeroViewComp extends CCComp {
/** 受击特效 */
private in_atked(anm: string = "atked", scale: number = 1) {
var path = "game/skill/end/" + anm;
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.setScale(node.scale.x * scale, node.scale.y);
node.setPosition(this.node.position.x, this.node.position.y+50, this.node.position.z);
node.parent = this.node.parent;
this.fsSprite.clickFlash();
// var path = "game/skill/end/" + anm;
// var prefab: Prefab = oops.res.get(path, Prefab)!;
// var node = instantiate(prefab);
// node.setScale(node.scale.x * scale, node.scale.y);
// node.setPosition(this.node.position.x, this.node.position.y+50, this.node.position.z);
// node.parent = this.node.parent;
}
/** 冰冻特效 */