diff --git a/assets/script/game/map/HInfoComp.ts b/assets/script/game/map/HInfoComp.ts index 9708afa3..71c0dd90 100644 --- a/assets/script/game/map/HInfoComp.ts +++ b/assets/script/game/map/HInfoComp.ts @@ -63,6 +63,7 @@ export class HInfoComp extends CCComp { @property(Node) Name_node=null! + /** 技能信息节点 */ @property(Node) info_node=null! @@ -81,6 +82,8 @@ export class HInfoComp extends CCComp { private model: HeroAttrsComp | null = null; /** 英雄名字标签缓存引用 */ private nameLabel: Label | null = null; + /** 技能信息标签缓存引用 */ + private infoLabel: Label | null = null; /** AP 标签缓存引用 */ private apLabel: Label | null = null; /** AP 加成标签缓存引用 */ @@ -183,6 +186,12 @@ export class HInfoComp extends CCComp { this.nameLabel.string = this.model.hero_name ?? ""; } + // ---- 技能信息标签 ---- + if (this.infoLabel) { + const heroData = HeroInfo[heroUuid]; + this.infoLabel.string = heroData?.info ?? ""; + } + // ---- 数值标签 ---- if (this.apLabel) { const currentAp = Math.max(0, Math.floor(this.model.ap ?? 0)); @@ -229,6 +238,9 @@ export class HInfoComp extends CCComp { if (!this.nameLabel && this.Name_node) { this.nameLabel = this.Name_node.getComponent(Label) || this.Name_node.getComponentInChildren(Label); } + if (!this.infoLabel && this.info_node) { + this.infoLabel = this.info_node.getComponent(Label) || this.info_node.getComponentInChildren(Label); + } if (!this.apLabel && this.ap_node) { this.apLabel = this.ap_node.getChildByName("val")?.getComponent(Label) || null; this.apPlusLabel = this.ap_node.getChildByName("plus")?.getComponent(Label) || null;