英雄界面继续完善

This commit is contained in:
2024-12-06 10:49:45 +08:00
parent da7d933c47
commit f47013d062
3 changed files with 4467 additions and 2141 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,8 @@ export class CardControllerComp extends CCComp {
}
start() {
this.hh_hide()
this.m_hide()
}
show_info(uuid:number,type:number){
@@ -41,11 +42,13 @@ export class CardControllerComp extends CCComp {
}
hh_show(){
let node=this.node.getChildByName("hero_home")
tween(node).to( 0.1,{ position: v3(0,node.position.y)}, ).start();
node.active = true
// tween(node).to( 0.1,{ position: v3(0,node.position.y)}, ).start();
}
hh_hide(){
let node=this.node.getChildByName("hero_home")
tween(node).to( 0.1,{ position: v3(1000,node.position.y)}, ).start();
node.active = false
// tween(node).to( 0.1,{ position: v3(2000,node.position.y)}, ).start();
}
mh_show(){

View File

@@ -1,4 +1,4 @@
import { _decorator,Button,EventHandler,EventTouch,instantiate,Label,NodeEventType,Prefab,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc";
import { _decorator,Button,EventHandler,EventTouch,instantiate,Label,NodeEventType,Prefab,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroList } from "../common/config/heroSet";
@@ -38,30 +38,56 @@ export class HeroHomeComp extends CCComp {
}
hero_show(uuid:number) {
console.log("hero_home hero_show:",uuid)
let lv = smc.vmdata.heros[uuid].lv
let slv = smc.vmdata.heros[uuid].slv
let role = smc.vmdata.heros[uuid]
let hero =smc.heros[uuid]
this.h_uuid=uuid
let slv_node=this.node.getChildByName("name").getChildByName("slv");
var icon_path = "game/heros/herois"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(hero.path);
});
this.node.getChildByName("name").getChildByName("value").getComponent(Label).string=hero.name
this.node.getChildByName("hero").getChildByName("lv").getComponent(Label).string = lv.toString()+"级";
let slv_node=this.node.getChildByName("hero").getChildByName("slv");
if(slv>=1) {slv_node.getChildByName("s1").active=true}else{slv_node.getChildByName("s1").active=false};
if(slv>=2) {slv_node.getChildByName("s2").active=true}else{slv_node.getChildByName("s2").active=false};
if(slv>=3) {slv_node.getChildByName("s3").active=true}else{slv_node.getChildByName("s3").active=false};
if(slv>=4) {slv_node.getChildByName("s4").active=true}else{slv_node.getChildByName("s4").active=false};
if(slv>=5) {slv_node.getChildByName("s5").active=true}else{slv_node.getChildByName("s5").active=false};
this.node.getChildByName("attr").getChildByName("ap").getChildByName("val").getComponent(Label).string = hero.ap+hero.ap_up*lv
this.node.getChildByName("attr").getChildByName("hp").getChildByName("val").getComponent(Label).string = hero.hp+hero.hp_up*lv
this.node.getChildByName("attr").getChildByName("def").getChildByName("val").getComponent(Label).string = hero.ap+hero.ap_up*lv
this.node.getChildByName("name").getChildByName("lv").getComponent(Label).string = role.lv.toString()+"级";
if( role.slv>=1) {slv_node.getChildByName("s1").active=true}else{slv_node.getChildByName("s1").active=false};
if( role.slv>=2) {slv_node.getChildByName("s2").active=true}else{slv_node.getChildByName("s2").active=false};
if( role.slv>=3) {slv_node.getChildByName("s3").active=true}else{slv_node.getChildByName("s3").active=false};
if( role.slv>=4) {slv_node.getChildByName("s4").active=true}else{slv_node.getChildByName("s4").active=false};
if( role.slv>=5) {slv_node.getChildByName("s5").active=true}else{slv_node.getChildByName("s5").active=false};
this.node.getChildByName("attr").getChildByName("ap").getChildByName("val").getComponent(Label).string = hero.ap+hero.ap_up* role.lv
this.node.getChildByName("attr").getChildByName("hp").getChildByName("val").getComponent(Label).string = hero.hp+hero.hp_up* role.lv
this.node.getChildByName("attr").getChildByName("def").getChildByName("val").getComponent(Label).string = hero.ap+hero.ap_up* role.lv
this.node.getChildByName("attr").getChildByName("acd").getChildByName("val").getComponent(Label).string = hero.a_cd
this.node.getChildByName("attr").getChildByName("speed").getChildByName("val").getComponent(Label).string = hero.speed
this.node.getChildByName("attr").getChildByName("dis").getChildByName("val").getComponent(Label).string = hero.dis
}
lv_selcet(e:any,val:any){
let active = this.node.getChildByName("menu").getChildByName("active")
tween(active).to(0.1,{position:v3(val,0)}).start()
let hero = this.node.getChildByName("hero")
let attr = this.node.getChildByName("attr")
let info = this.node.getChildByName("info")
let lvup = this.node.getChildByName("lvup")
let sk = this.node.getChildByName("sk")
let slvup = this.node.getChildByName("slvup")
if(val < 0){
tween(hero).to(0.2,{position:v3(0,hero.position.y)}).start()
tween(attr).to(0.2,{position:v3(0,attr.position.y)}).start()
tween(info).to(0.2,{position:v3(0,info.position.y)}).start()
tween(lvup).to(0.2,{position:v3(0,lvup.position.y)}).start()
tween(sk).to(0.2,{position:v3(1000,sk.position.y)}).start()
tween(slvup).to(0.2,{position:v3(1000,slvup.position.y)}).start()
}else{
tween(hero).to(0.2,{position:v3(-1000,hero.position.y)}).start()
tween(attr).to(0.2,{position:v3(-1000,attr.position.y)}).start()
tween(info).to(0.2,{position:v3(-1000,info.position.y)}).start()
tween(lvup).to(0.2,{position:v3(-1000,lvup.position.y)}).start()
tween(sk).to(0.2,{position:v3(0,sk.position.y)}).start()
tween(slvup).to(0.2,{position:v3(0,slvup.position.y)}).start()
}
}
lv_up(){
console.log("lvup h_uuid:",this.h_uuid)
}