diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 7ed74eea..881c3b7f 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -430,17 +430,17 @@ export class HeroViewComp extends CCComp { playSkillEffect(skill_id:number) { let skill = SkillSet[skill_id] + console.log('[heroview] skill_id'+skill_id,skill) + if (!skill) return; switch(skill.act){ case "max": this.as.max() - this.tooltip(TooltipTypes.skill, skill.name) break case "atk": this.as.atk() break case "buff": this.as.buff() - this.tooltip(TooltipTypes.skill, skill.name) break } } diff --git a/assets/script/game/skill/TooltipCom.ts b/assets/script/game/skill/TooltipCom.ts index e0ac7712..7f9016f1 100644 --- a/assets/script/game/skill/TooltipCom.ts +++ b/assets/script/game/skill/TooltipCom.ts @@ -59,7 +59,12 @@ export class TooltipCom extends CCComp { },0.5) break case TooltipTypes.skill: - this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = "<"+SkillSet[this.s_uuid].name+">"; + const skillConfig = SkillSet[this.s_uuid]; + if (skillConfig) { + this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = "<"+skillConfig.name+">"; + } else { + this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = ""; + } this.node.getChildByName("skill").active=true; this.node.setPosition(v3(this.node.position.x,this.node.position.y+30)) this.scheduleOnce(()=>{