This commit is contained in:
2024-12-21 11:03:54 +08:00
parent e34eb5452b
commit e6e3db0f80
30 changed files with 3206 additions and 1814 deletions

View File

@@ -12,6 +12,7 @@ import { MSCard } from "./MSCard";
import { CardControllerComp } from "./CardController";
import { MissionComp } from "./MissionComp";
import { MSCardComp } from "./MSCardComp";
import { HeroSelectComp } from "../hero/HeroSelectComp";
const { ccclass, property } = _decorator;
@@ -63,20 +64,29 @@ export class MissionHomeComp extends CCComp {
this.node.active=false;
}
load_hero_card(){
let loaded:any = ecs.query(ecs.allOf(HeroSelectComp));
if(loaded.length>0){
for(let i=0;i<loaded.length;i++){
loaded[i].HeroSelectComp.reset()
loaded[i].HeroSelectComp.ent.destroy()
}
}
let hc:number =HeroList.length
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
let height=Math.ceil(hc / 4)*135
parent.getComponent(UITransform).width=height
parent.getComponent(UITransform).height=height
for (let i = 0; i < hc; i++) {
let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
hcc.load(HeroList[i],parent)
if(smc.heros[HeroList[i]].slv > 0) {
let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
hcc.load(HeroList[i],parent)
}
}
}
load_skill_card(){
let ms_num:number =MSklist.length
let parent= this.node.getChildByName("skills").getChildByName("view").getChildByName("content")
let height=ms_num*135
parent.getComponent(UITransform).width=height
parent.getComponent(UITransform).height=height
for (let i = 0; i < ms_num; i++) {
let msc =ecs.getEntity<MSCard>(MSCard)
msc.load(MSklist[i],parent,2)