fix(hero view): adjust血条顶部节点偏移量
统一配置血条顶部节点的Y轴偏移参数,区分普通英雄和Boss的血条高度,替换硬编码数值
This commit is contained in:
@@ -35,6 +35,8 @@ export class HeroViewComp extends CCComp {
|
||||
realDeadTime:number=0.1
|
||||
deadCD:number=0
|
||||
monDeadTime:number=0.1
|
||||
hp_height:number=70
|
||||
boss_hp_height:number=120
|
||||
// 血条显示相关
|
||||
lastBarUpdateTime:number = 0; // 最后一次血条/蓝条/护盾更新时间
|
||||
// ==================== UI 节点引用 ====================
|
||||
@@ -114,8 +116,8 @@ export class HeroViewComp extends CCComp {
|
||||
private initUINodes() {
|
||||
this.top_node = this.node.getChildByName("top");
|
||||
this.topOpacity = this.top_node.getComponent(UIOpacity) || this.top_node.addComponent(UIOpacity);
|
||||
this.top_node.setPosition(0, 80, 0);
|
||||
if(this.model.is_boss) this.top_node.setPosition(0, 105, 0);
|
||||
this.top_node.setPosition(0, this.hp_height, 0);
|
||||
if(this.model.is_boss) this.top_node.setPosition(0, this.boss_hp_height, 0);
|
||||
this.topBasePos = this.top_node.position.clone();
|
||||
const hpNode = this.top_node.getChildByName("hp");
|
||||
if(this.model.fac==FacSet.HERO){
|
||||
|
||||
Reference in New Issue
Block a user