清理掉 missioncomp的 抽卡相关的 游戏逻辑
This commit is contained in:
@@ -26,21 +26,34 @@ export class MissionHeroCompComp extends CCComp {
|
||||
this.on(GameEvent.UseHeroCard,this.call_hero,this)
|
||||
this.on(GameEvent.FightReady,this.fight_ready,this)
|
||||
this.on(GameEvent.Zhaohuan,this.zhao_huan,this)
|
||||
this.on(GameEvent.FightEnd,this.clear_heros,this)
|
||||
}
|
||||
start() {
|
||||
// this.test_call()
|
||||
}
|
||||
clear_heros(){
|
||||
console.log("[MissionHeroComp]: FightEnd clear heros")
|
||||
|
||||
}
|
||||
fight_ready(){
|
||||
this.heros=[]
|
||||
for(let i=0;i<FightSet.HERO_MAX_NUM;i++){
|
||||
this.heros.push({
|
||||
uuid:0,
|
||||
count:0,
|
||||
quality:0,
|
||||
})
|
||||
// this.heros=[]
|
||||
// for(let i=0;i<FightSet.HERO_MAX_NUM;i++){
|
||||
// this.heros.push({
|
||||
// uuid:0,
|
||||
// count:0,
|
||||
// quality:0,
|
||||
// })
|
||||
// }
|
||||
// this.current_hero_num=-1
|
||||
// this.current_hero_uuid=0
|
||||
console.log("[MissionHeroComp]:fight_ready",smc.fight_heros,Object.keys(smc.fight_heros).length)
|
||||
let heros:any = smc.fight_heros
|
||||
for(let i=0;i<Object.keys(heros).length;i++){
|
||||
if(heros[i]!=0){
|
||||
console.log("[MissionHeroComp]:fight_ready",heros[i])
|
||||
this.addHero(heros[i],false)
|
||||
}
|
||||
}
|
||||
this.current_hero_num=-1
|
||||
this.current_hero_uuid=0
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(smc.mission.status != 1) return
|
||||
@@ -105,6 +118,7 @@ export class MissionHeroCompComp extends CCComp {
|
||||
|
||||
/** 添加英雄 */
|
||||
private addHero(uuid:number=1001,is_zhaohuan:boolean=false) {
|
||||
console.log("[MissionHeroComp]:addHero",uuid,is_zhaohuan)
|
||||
let hero_pos=0
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
|
||||
Reference in New Issue
Block a user