refactor(gui): 移除未使用的资源文件并调整英雄技能显示
删除未使用的图片和prefab资源文件 调整英雄控制器prefab的位置和尺寸 修改英雄信息组件显示技能信息而非魔法防御属性 更新胜利界面prefab的布局和样式
This commit is contained in:
@@ -5,6 +5,7 @@ import { smc } from '../common/SingletonModuleComp';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { SkillSet } from '../common/config/SkillSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('HInfoComp')
|
||||
@@ -17,8 +18,8 @@ export class HInfoComp extends CCComp {
|
||||
hp_node:any=null
|
||||
def_node:any=null
|
||||
mp_node:any=null
|
||||
map_node:any=null
|
||||
mdef_node:any=null
|
||||
skill1_node:any=null
|
||||
skill2_node:any=null
|
||||
// 重新定义节点映射,使名称更清晰
|
||||
// 当前显示的英雄节点数组(7个位置)
|
||||
heroNodes: (Node | null)[] = [null, null, null, null, null, null, null];
|
||||
@@ -67,9 +68,9 @@ export class HInfoComp extends CCComp {
|
||||
this.hp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("bgs").getChildByName("hp")
|
||||
this.mp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("bgs").getChildByName("mp")
|
||||
this.ap_node=this.node.getChildByName("info").getChildByName("base").getChildByName("bgs").getChildByName("ap")
|
||||
this.map_node=this.node.getChildByName("info").getChildByName("base").getChildByName("bgs").getChildByName("map")
|
||||
this.def_node=this.node.getChildByName("info").getChildByName("base").getChildByName("bgs").getChildByName("def")
|
||||
this.mdef_node=this.node.getChildByName("info").getChildByName("base").getChildByName("bgs").getChildByName("mdef")
|
||||
this.skill1_node=this.node.getChildByName("info").getChildByName("base").getChildByName("skills").getChildByName("skill1")
|
||||
this.skill2_node=this.node.getChildByName("info").getChildByName("base").getChildByName("skills").getChildByName("skill2")
|
||||
this.h_uuid=smc.fight_hero
|
||||
this.update_data(this.h_uuid)
|
||||
this.load_all_hero(this.h_uuid)
|
||||
@@ -79,20 +80,20 @@ export class HInfoComp extends CCComp {
|
||||
}
|
||||
update_data(uuid:number){
|
||||
this.h_uuid=uuid
|
||||
this.name_node.getComponent(Label).string=HeroInfo[uuid].name
|
||||
let skill1=SkillSet[HeroInfo[uuid].skills[0]]
|
||||
let skill2=SkillSet[HeroInfo[uuid].skills[1]]
|
||||
this.skill1_node.getChildByName("info").getChildByName("Label").getComponent(Label).string=skill1.info
|
||||
this.skill2_node.getChildByName("info").getChildByName("Label").getComponent(Label).string=skill2.info
|
||||
this.name_node.getComponent(Label).string=HeroInfo[uuid].name
|
||||
this.type_node.getComponent(Label).string=HTypeName[HeroInfo[uuid].type]
|
||||
this.ap_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].ap.toString()
|
||||
this.hp_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].hp.toString()
|
||||
this.def_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].def.toString()
|
||||
this.mdef_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].mdef.toString()
|
||||
this.map_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].map.toString()
|
||||
this.mp_node.getChildByName("num").getComponent(Label).string=HeroInfo[uuid].mp.toString()
|
||||
let bar_num=getPreAttr(uuid)
|
||||
this.ap_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.ap
|
||||
this.hp_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.hp
|
||||
this.def_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.def
|
||||
this.mdef_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.mdef
|
||||
this.map_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.map
|
||||
this.mp_node.getChildByName("bar").getComponent(ProgressBar).progress=bar_num.mp
|
||||
}
|
||||
load_all_hero(uuid:number){
|
||||
|
||||
Reference in New Issue
Block a user