局内技能选择开始,需要先完成技能设置,确定局内技能数据
This commit is contained in:
@@ -23,7 +23,7 @@ export class MissionHomeComp extends CCComp {
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
]
|
||||
|
||||
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
@@ -31,7 +31,8 @@ export class MissionHomeComp extends CCComp {
|
||||
this.loads()
|
||||
this.load_ui_heros()
|
||||
}
|
||||
start_mission() {
|
||||
|
||||
start_mission(e:any,args:any) {
|
||||
console.log("start_mission")
|
||||
for(let i=0;i<this.heros.length;i++){
|
||||
this.heros[i].to_destroy()
|
||||
@@ -44,14 +45,15 @@ export class MissionHomeComp extends CCComp {
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
]
|
||||
if(args!=0){
|
||||
this.load_ui_heros()
|
||||
}
|
||||
}
|
||||
load_ui_heros(){
|
||||
for(let i=0;i<smc.vmdata.fight_heros.length;i++){
|
||||
this.select_hero(smc.vmdata.fight_heros[i])
|
||||
}
|
||||
}
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
select_hero(h_uuid:number){
|
||||
console.log("select_hero",h_uuid)
|
||||
for(let i=0;i<4;i++){
|
||||
@@ -95,27 +97,31 @@ export class MissionHomeComp extends CCComp {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
load_ui_heros(){
|
||||
for(let i=0;i<smc.vmdata.fight_heros.length;i++){
|
||||
this.select_hero(smc.vmdata.fight_heros[i])
|
||||
}
|
||||
}
|
||||
loads(){
|
||||
let hc:number =HeroList.length
|
||||
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
|
||||
parent.getComponent(UITransform).width=hc*150
|
||||
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)
|
||||
}
|
||||
}
|
||||
show_uiheros(){
|
||||
|
||||
}
|
||||
show_heros(){
|
||||
this.node.getChildByName("heros").setPosition(0,290)
|
||||
this.node.getChildByName("heros").setPosition(0,290)
|
||||
}
|
||||
hide_heros(){
|
||||
this.node.getChildByName("heros").setPosition(0,-400)
|
||||
this.node.getChildByName("heros").setPosition(0,-800)
|
||||
}
|
||||
show_skills(){
|
||||
this.node.getChildByName("skills").setPosition(0,400)
|
||||
}
|
||||
hide_skills(){
|
||||
this.node.getChildByName("skills").setPosition(0,-800)
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user