refactor(ui): 将英雄等级和动画显示逻辑移至HInfoComp
- 移除HeroViewComp中等级和CD进度条的显示逻辑,简化顶部UI - 在HInfoComp中新增英雄等级显示和动画加载功能 - 添加资源加载和动画管理逻辑,支持英雄闲置动画播放 - 优化组件生命周期管理,确保资源正确释放
This commit is contained in:
@@ -97,11 +97,9 @@ export class HeroViewComp extends CCComp {
|
||||
this.top_node.setScale(this.scale*this.top_node.scale.x,1*this.top_node.scale.y);
|
||||
/* 显示角色血*/
|
||||
this.top_node.getChildByName("hp").active = true;
|
||||
this.top_node.getChildByName("cd").active = true
|
||||
this.top_node.getChildByName("cd").active = false;
|
||||
this.top_node.getChildByName("shield").active = false;
|
||||
this.top_node.getChildByName("lv").active = this.model.fac==FacSet.HERO;
|
||||
this.top_node.getChildByName("lv").getChildByName("lv2").active=this.model.lv >= 2
|
||||
this.top_node.getChildByName("lv").getChildByName("lv3").active=this.model.lv >= 3
|
||||
this.top_node.getChildByName("lv").active = false;
|
||||
this.top_node.active = true;
|
||||
this.setTopBarOpacity(false);
|
||||
|
||||
@@ -162,7 +160,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
public cd_show(){
|
||||
this.top_node.getChildByName("cd").getComponent(ProgressBar).progress = this.model.getDisplaySkillCdProgress();
|
||||
return;
|
||||
}
|
||||
|
||||
/** 显示护盾 */
|
||||
|
||||
Reference in New Issue
Block a user