继续
This commit is contained in:
@@ -7,7 +7,7 @@ import { UiHeroComp } from "../hero/UiHeroComp";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroSelect } from "../hero/HeroSelect";
|
||||
import { MSklist } from "../common/config/SkillSet";
|
||||
import { MSklist, SkillSet } from "../common/config/SkillSet";
|
||||
import { MSCard } from "./MSCard";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -32,8 +32,29 @@ export class MissionHomeComp extends CCComp {
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
this.load_hero_card()
|
||||
this.load_ui_heros()
|
||||
this.load_skill_card()
|
||||
|
||||
}
|
||||
load_hero_card(){
|
||||
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
|
||||
for (let i = 0; i < hc; i++) {
|
||||
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
|
||||
for (let i = 0; i < ms_num; i++) {
|
||||
let msc =ecs.getEntity<MSCard>(MSCard)
|
||||
msc.load(MSklist[i],parent,2)
|
||||
}
|
||||
}
|
||||
|
||||
start_mission(e:any,args:any) {
|
||||
console.log("mission home start_mission")
|
||||
for(let i=0;i<this.heros.length;i++){
|
||||
@@ -52,8 +73,8 @@ export class MissionHomeComp extends CCComp {
|
||||
}
|
||||
}
|
||||
load_ui_heros(){
|
||||
for(let i=0;i<smc.vmdata.fight_heros.length;i++){
|
||||
this.select_hero(smc.vmdata.fight_heros[i])
|
||||
for(let i=0;i<smc.fight_heros.length;i++){
|
||||
this.select_hero(smc.fight_heros[i])
|
||||
}
|
||||
}
|
||||
select_hero(h_uuid:number){
|
||||
@@ -94,29 +115,9 @@ export class MissionHomeComp extends CCComp {
|
||||
}
|
||||
}
|
||||
}
|
||||
load_hero_card(){
|
||||
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
|
||||
for (let i = 0; i < hc; i++) {
|
||||
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
|
||||
for (let i = 0; i < ms_num; i++) {
|
||||
let msc =ecs.getEntity<MSCard>(MSCard)
|
||||
msc.load(HeroList[i],parent,1)
|
||||
}
|
||||
}
|
||||
show_uiheros(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
show_heros(){
|
||||
this.node.getChildByName("heros").setPosition(0,290)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user