feat(英雄技能): 添加技能前摇与后摇动画支持
- 在 SCastSystem 中调用 playReady 播放技能前摇动画 - 在 HeroAtkSystem 中调用 playEnd 播放技能后摇动画 - 将 playSkillEffect 重构为 playSkillAnm 以播放角色攻击动画 - 修复 HeroViewComp 中 playReady 方法名拼写错误
This commit is contained in:
@@ -158,7 +158,10 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
|||||||
|
|
||||||
|
|
||||||
// ✅ 触发视图层表现(伤害数字、受击动画、后退)
|
// ✅ 触发视图层表现(伤害数字、受击动画、后退)
|
||||||
if (targetView) targetView.do_atked(damage, isCrit, damageEvent.s_uuid, isBack);
|
if (targetView) {
|
||||||
|
targetView.do_atked(damage, isCrit, damageEvent.s_uuid, isBack);
|
||||||
|
targetView.playEnd(skillConf.endAnm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 检查死亡
|
// 检查死亡
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
node.parent = this.node;
|
node.parent = this.node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public palayReady(anm: string = ""){
|
public playReady(anm: string = ""){
|
||||||
if(anm==="") return;
|
if(anm==="") return;
|
||||||
var path = "game/skill/ready/" + anm;
|
var path = "game/skill/ready/" + anm;
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
@@ -516,11 +516,10 @@ export class HeroViewComp extends CCComp {
|
|||||||
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem
|
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem
|
||||||
|
|
||||||
|
|
||||||
playSkillEffect(skill_id:number) {
|
playSkillAnm(act:string="") {
|
||||||
let skill = SkillSet[skill_id]
|
mLogger.log(this.debugMode, 'HeroViewComp', '[heroview] act'+act,)
|
||||||
mLogger.log(this.debugMode, 'HeroViewComp', '[heroview] skill_id'+skill_id,skill)
|
if (act==="") return;
|
||||||
if (!skill) return;
|
switch(act){
|
||||||
switch(skill.act){
|
|
||||||
case "max":
|
case "max":
|
||||||
this.as.max()
|
this.as.max()
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -70,7 +70,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
const s_uuid = castPlan.skillId;
|
const s_uuid = castPlan.skillId;
|
||||||
const config = SkillSet[s_uuid];
|
const config = SkillSet[s_uuid];
|
||||||
if (!config) return;
|
if (!config) return;
|
||||||
heroView.playSkillEffect(s_uuid);
|
//播放前摇技能动画
|
||||||
|
heroView.playReady(config.readyAnm);
|
||||||
|
//播放角色攻击动画
|
||||||
|
heroView.playSkillAnm(config.act);
|
||||||
const isMainSkill = s_uuid === heroAttrs.skill_id;
|
const isMainSkill = s_uuid === heroAttrs.skill_id;
|
||||||
|
|
||||||
// 优先使用技能配置的前摇时间,否则使用全局默认值
|
// 优先使用技能配置的前摇时间,否则使用全局默认值
|
||||||
|
|||||||
Reference in New Issue
Block a user