feat(hero): 添加受击闪光效果并重构相关代码

新增FlashSprite组件实现受击闪光效果
重构HeroAnmComp和HeroViewComp以支持闪光效果
更新多个英雄prefab以包含闪光材质和组件
This commit is contained in:
2025-11-15 11:15:30 +08:00
parent 4af9a6fd9e
commit 46a779633a
28 changed files with 2800 additions and 862 deletions

View File

@@ -14,7 +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;
@@ -38,7 +38,6 @@ export class HeroViewComp extends CCComp {
// 血条显示相关
hpBarShowTime:number = 5; // 血条显示持续时间(秒)
hpBarShowCD:number = 0; // 血条显示计时器
fsSprite:FlashSprite = null!;
// ==================== UI 节点引用 ====================
private top_node: Node = null!;
@@ -103,7 +102,6 @@ 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);
}
@@ -217,7 +215,7 @@ export class HeroViewComp extends CCComp {
/** 受击特效 */
private in_atked(anm: string = "atked", scale: number = 1) {
this.fsSprite.clickFlash();
this.as.do_atked()
// var path = "game/skill/end/" + anm;
// var prefab: Prefab = oops.res.get(path, Prefab)!;
// var node = instantiate(prefab);