mission_end
This commit is contained in:
@@ -25,6 +25,7 @@ export class VictoryComp extends CCComp {
|
||||
// console.log("VictoryComp start")
|
||||
oops.message.on("minssion_victory", this.do_victiry, this);
|
||||
oops.message.on("minssion_defeat", this.do_defeat, this);
|
||||
console.log("VictoryComp start")
|
||||
}
|
||||
private do_victiry() {
|
||||
smc.vm_data.mission.play=false
|
||||
@@ -53,36 +54,9 @@ export class VictoryComp extends CCComp {
|
||||
}
|
||||
end_mission(){
|
||||
this.node.getChildByName("Node").active=false
|
||||
smc.vm_data.role.gold += smc.vm_data.mission.reward_gold
|
||||
smc.vm_data.role.exp += smc.vm_data.mission.reward_exp
|
||||
console.log("end_mission",this.rerawd_item,smc.vm_data.role.exp)
|
||||
// smc.vm_data.role.items[this.rerawd_item.uuid].num += this.reward_num
|
||||
|
||||
smc.vm_data.mission.reward_gold=0
|
||||
smc.vm_data.mission.reward_exp=0
|
||||
this.empty_mission()
|
||||
oops.message.dispatchEvent("to_mission")
|
||||
console.log("end_mission",smc.vm_data.role.items)
|
||||
}
|
||||
empty_mission(){
|
||||
let monsters:any= ecs.query(ecs.allOf(MonViewComp));
|
||||
let heros:any= ecs.query(ecs.allOf(HeroViewComp));
|
||||
let roles:any= ecs.query(ecs.allOf(RoleViewComp));
|
||||
let boss:any= ecs.query(ecs.allOf(BossViewComp));
|
||||
for(let i=0;i<monsters.length;i++){
|
||||
monsters[i].MonView.ent.destroy()
|
||||
}
|
||||
for(let i=0;i<heros.length;i++){
|
||||
heros[i].HeroView.ent.destroy()
|
||||
}
|
||||
for(let i=0;i<roles.length;i++){
|
||||
roles[i].RoleView.ent.destroy()
|
||||
}
|
||||
for(let i=0;i<boss.length;i++){
|
||||
boss[i].BossView.ent.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
|
||||
Reference in New Issue
Block a user