环境技能基本完成 todo 技能cd动画 技能执行
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, instantiate, Prefab, UITransform } from "cc";
|
||||
import { _decorator, instantiate, Prefab, resources, Sprite, SpriteAtlas, UITransform } 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 { HeroInfo, HeroList } from "../common/config/heroSet";
|
||||
@@ -33,7 +33,24 @@ export class MissionHomeComp extends CCComp {
|
||||
this.load_hero_card()
|
||||
this.load_ui_heros()
|
||||
this.load_skill_card()
|
||||
|
||||
this.select_skill()
|
||||
}
|
||||
start_mission(e:any,args:any) {
|
||||
console.log("mission home start_mission")
|
||||
for(let i=0;i<this.heros.length;i++){
|
||||
this.heros[i].to_destroy()
|
||||
}
|
||||
this.heros=[]
|
||||
this.heros_pos=[
|
||||
{uuid:0,px:-300},
|
||||
{uuid:0,px:-200},
|
||||
{uuid:0,px:-100},
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
]
|
||||
if(args!=0){
|
||||
this.load_ui_heros()
|
||||
}
|
||||
}
|
||||
load_hero_card(){
|
||||
let hc:number =HeroList.length
|
||||
@@ -55,28 +72,19 @@ export class MissionHomeComp extends CCComp {
|
||||
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++){
|
||||
this.heros[i].to_destroy()
|
||||
}
|
||||
this.heros=[]
|
||||
this.heros_pos=[
|
||||
{uuid:0,px:-300},
|
||||
{uuid:0,px:-200},
|
||||
{uuid:0,px:-100},
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
]
|
||||
if(args!=0){
|
||||
this.load_ui_heros()
|
||||
}
|
||||
}
|
||||
load_ui_heros(){
|
||||
for(let i=0;i<smc.fight_heros.length;i++){
|
||||
this.select_hero(smc.fight_heros[i])
|
||||
}
|
||||
}
|
||||
select_skill(){
|
||||
if(SkillSet[smc.mission.mskill]==undefined) return
|
||||
var icon_path = "game/skills/skill_icon"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("msk").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[smc.mission.mskill].path);
|
||||
});
|
||||
}
|
||||
select_hero(h_uuid:number){
|
||||
for(let i=0;i<4;i++){
|
||||
if(this.heros_pos[i].uuid==0){
|
||||
@@ -115,7 +123,7 @@ export class MissionHomeComp extends CCComp {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
show_heros(){
|
||||
|
||||
Reference in New Issue
Block a user