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