feat: 为召唤和死亡触发技能添加动画效果

- 在 Hero、Monster 和 HeroAtkSystem 中分发技能触发事件时,增加 triggerType 参数以区分召唤和死亡
- 修改 SCastSystem 的 forceCastTriggerSkill 方法,根据 triggerType 播放对应的准备动画(黄色表示召唤,死亡动画表示死亡)
- 调整 hnode.prefab 中按钮的布局和样式,移除特定精灵帧以使用默认样式
This commit is contained in:
walkpan
2026-04-05 22:49:01 +08:00
parent 8b4ccfd484
commit c054209025
16 changed files with 484 additions and 2449 deletions

View File

@@ -6,6 +6,7 @@ import { HeroSpine } from "./HeroSpine";
import { BoxSet, FacSet, FightSet, NumberFormatter, TooltipTypes } from "../common/config/GameSet";
import { smc } from "../common/SingletonModuleComp";
import { SkillSet,} from "../common/config/SkillSet";
import { HeroInfo } from "../common/config/heroSet";
import { oops } from "db://oops-framework/core/Oops";
import { HeroAttrsComp } from "./HeroAttrsComp";
import { Tooltip } from "../skill/Tooltip";
@@ -300,7 +301,11 @@ export class HeroViewComp extends CCComp {
var path = "game/skill/ready/" + anm;
this.spawnAnimEndFx(path, this.node, undefined);
}
public playOther(anm: string = ""){
if(anm==="") return;
var path = "game/skill/ready/" + anm;
this.spawnAnimEndFx(path, this.node.parent, undefined);
}
public playEnd(anm: string = ""){
if(anm==="") return;
var path = "game/skill/end/" + anm;
@@ -417,9 +422,14 @@ export class HeroViewComp extends CCComp {
this.realDeadTime = this.monDeadTime;
}
// 播放死亡特效
this.deaded();
// 如果角色带有死亡触发技能,则由 SCastSystem 播放 playReady("dead"),不播放原有的 deaded 特效
const heroInfo = HeroInfo[this.model.hero_uuid];
if (heroInfo && heroInfo.dead) {
// SCastSystem will handle the "dead" ready animation
} else {
// 播放默认死亡特效
this.deaded();
}
}
realDead(){
// 🔥 修复添加model安全检查防止实体销毁过程中的空指针异常