fix(hero): 修复英雄视图初始化时未更新信息的问题
在HeroViewComp初始化时调用smc.updateHeroInfo更新英雄信息,确保视图与模型同步
This commit is contained in:
@@ -124,6 +124,7 @@ 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);
|
||||
smc.updateHeroInfo(this.model)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user