ui调整,背景地图调整
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3 } from 'cc';
|
||||
import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3, ProgressBar } from 'cc';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { getHeroList, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
|
||||
import { getHeroList, getPreAttr, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
||||
@@ -16,6 +16,9 @@ export class HInfoComp extends CCComp {
|
||||
ap_node:any=null
|
||||
hp_node:any=null
|
||||
def_node:any=null
|
||||
mp_node:any=null
|
||||
map_node:any=null
|
||||
mdef_node:any=null
|
||||
// 重新定义节点映射,使名称更清晰
|
||||
// 当前显示的英雄节点数组(7个位置)
|
||||
heroNodes: (Node | null)[] = [null, null, null, null, null, null, null];
|
||||
@@ -24,9 +27,9 @@ export class HInfoComp extends CCComp {
|
||||
hero_pos:any={
|
||||
0:v3(420,-57,0), // 不在屏幕内
|
||||
1:v3(280,-57,0),
|
||||
2:v3(140,-57,0),
|
||||
2:v3(160,-57,0),
|
||||
3:v3(0,-67,0),
|
||||
4:v3(-140,-57,0),
|
||||
4:v3(-160,-57,0),
|
||||
5:v3(-280,-57,0),
|
||||
6:v3(-420,-57,0), // 不在屏幕内
|
||||
}
|
||||
@@ -44,9 +47,12 @@ export class HInfoComp extends CCComp {
|
||||
start() {
|
||||
this.name_node=this.node.getChildByName("hero").getChildByName("hname").getChildByName("name")
|
||||
this.type_node=this.node.getChildByName("hero").getChildByName("hname").getChildByName("type")
|
||||
this.ap_node=this.node.getChildByName("info").getChildByName("base").getChildByName("ap").getChildByName("num")
|
||||
this.hp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("hp").getChildByName("num")
|
||||
this.def_node=this.node.getChildByName("info").getChildByName("base").getChildByName("def").getChildByName("num")
|
||||
this.ap_node=this.node.getChildByName("info").getChildByName("base").getChildByName("ap")
|
||||
this.hp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("hp")
|
||||
this.def_node=this.node.getChildByName("info").getChildByName("base").getChildByName("def")
|
||||
this.mdef_node=this.node.getChildByName("info").getChildByName("base").getChildByName("mdef")
|
||||
this.map_node=this.node.getChildByName("info").getChildByName("base").getChildByName("map")
|
||||
this.mp_node=this.node.getChildByName("info").getChildByName("base").getChildByName("mp")
|
||||
this.h_uuid=smc.fight_hero
|
||||
this.update_data(this.h_uuid)
|
||||
this.load_all_hero(this.h_uuid)
|
||||
@@ -56,11 +62,21 @@ export class HInfoComp extends CCComp {
|
||||
}
|
||||
update_data(uuid:number){
|
||||
this.h_uuid=uuid
|
||||
this.name_node.getComponent(Label).string=HeroInfo[uuid].name
|
||||
this.name_node.getComponent(Label).string=HeroInfo[uuid].name
|
||||
this.type_node.getComponent(Label).string=HTypeName[HeroInfo[uuid].type]
|
||||
this.ap_node.getComponent(Label).string=HeroInfo[uuid].ap.toString()
|
||||
this.hp_node.getComponent(Label).string=HeroInfo[uuid].hp.toString()
|
||||
this.def_node.getComponent(Label).string=HeroInfo[uuid].def.toString()
|
||||
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