奖励系统基础完成, todo: 英雄碎片,英雄成长系统
This commit is contained in:
@@ -60,11 +60,9 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
|
||||
to_mission(){
|
||||
oops.message.dispatchEvent("mission_end")
|
||||
this.node.getChildByName("mission_home").active=true
|
||||
this.node.getChildByName("mission").active=false
|
||||
this.node.getChildByName("bar").active=true;
|
||||
|
||||
this.node.getChildByName("hero_home").active=false
|
||||
this.node.getChildByName("shop_home").active=false
|
||||
this.node.getChildByName("bar").getChildByName("mission_btn").getChildByName("bg").active=true
|
||||
|
||||
@@ -33,7 +33,6 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('MissionComp')
|
||||
@ecs.register('Mission', false)
|
||||
export class MissionComp extends CCComp {
|
||||
VictoryNode: any = null;
|
||||
VictoryComp:any = null;
|
||||
mon_list:any = []
|
||||
call_hero_timer: Timer = new Timer(0.3);
|
||||
@@ -58,9 +57,7 @@ export class MissionComp extends CCComp {
|
||||
|
||||
}
|
||||
start() {
|
||||
this.VictoryNode=this.node.getChildByName("victory")
|
||||
this.VictoryNode.active=false
|
||||
this.VictoryComp=this.VictoryNode.getComponent(VictoryComp)
|
||||
this.VictoryComp=this.node.getChildByName("victory").getComponent(VictoryComp)
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
@@ -281,10 +278,10 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
to_end_mission(){
|
||||
if (smc.vm_data.mission.is_victory){
|
||||
this.VictoryNode.active=true
|
||||
this.VictoryComp.do_victiry()
|
||||
}
|
||||
if (smc.vm_data.mission.is_defeat){
|
||||
this.VictoryNode.active=true
|
||||
this.VictoryComp.do_defeat()
|
||||
}
|
||||
}
|
||||
get_mons(){
|
||||
|
||||
@@ -22,25 +22,14 @@ export class VictoryComp extends CCComp {
|
||||
rerawd_item:any={}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// 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
|
||||
if(smc.vm_data.role.mission%10==0){
|
||||
smc.vm_data.role.mission_finish == true
|
||||
}else{
|
||||
smc.vm_data.role.mission += 1
|
||||
}
|
||||
this.node.getChildByName("Node").active = true;
|
||||
this.getReward()
|
||||
this.node.getChildByName("Node").getChildByName("defeat").active = false
|
||||
this.node.getChildByName("Node").getChildByName("victory").active = true;
|
||||
}
|
||||
private do_defeat() {
|
||||
smc.vm_data.mission.play=false
|
||||
this.node.getChildByName("Node").active = true;
|
||||
this.getReward()
|
||||
this.node.getChildByName("Node").getChildByName("victory").active = false;
|
||||
|
||||
Reference in New Issue
Block a user