fix(hero): 移除蓝条显示逻辑及相关更新检查
由于怪物不需要显示蓝条,直接移除蓝条的显示逻辑及相关更新检查,简化代码
This commit is contained in:
@@ -104,10 +104,9 @@ export class HeroViewComp extends CCComp {
|
|||||||
|
|
||||||
/* 显示角色血*/
|
/* 显示角色血*/
|
||||||
this.top_node.getChildByName("hp").active = true;
|
this.top_node.getChildByName("hp").active = true;
|
||||||
// 🔥 怪物不显示蓝条
|
|
||||||
if (this.model) {
|
this.top_node.getChildByName("mp").active = false
|
||||||
this.top_node.getChildByName("mp").active = this.model.fac === FacSet.HERO;
|
|
||||||
}
|
|
||||||
this.top_node.getChildByName("shield").active = false;
|
this.top_node.getChildByName("shield").active = false;
|
||||||
// 初始隐藏血条(有更新时才显示)
|
// 初始隐藏血条(有更新时才显示)
|
||||||
this.top_node.active = false;
|
this.top_node.active = false;
|
||||||
@@ -160,10 +159,10 @@ export class HeroViewComp extends CCComp {
|
|||||||
this.model.dirty_hp = false;
|
this.model.dirty_hp = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.model.dirty_mp) {
|
// if (this.model.dirty_mp) {
|
||||||
this.mp_show();
|
// this.mp_show();
|
||||||
this.model.dirty_mp = false;
|
// this.model.dirty_mp = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (this.model.dirty_shield) {
|
if (this.model.dirty_shield) {
|
||||||
this.show_shield(this.model.shield, this.model.Attrs[Attrs.SHIELD_MAX]);
|
this.show_shield(this.model.shield, this.model.Attrs[Attrs.SHIELD_MAX]);
|
||||||
|
|||||||
Reference in New Issue
Block a user