dd
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -171,7 +171,7 @@ export class RoleViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
@@ -79,6 +79,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
mission:{
|
||||
play:false,
|
||||
pause:false,
|
||||
refresh_timer:4,
|
||||
victory:0,
|
||||
once:6, //每波刷新怪物数量
|
||||
total:120, //总怪物数
|
||||
|
||||
@@ -174,7 +174,7 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
@@ -12,6 +12,10 @@ import { GameMap } from "./GameMap";
|
||||
import { MapModelComp } from "./model/MapModelComp";
|
||||
import { Talent } from "../Role/Talent";
|
||||
import { Talents } from "../common/config/TalentSet";
|
||||
import { MonViewComp } from "../mon/MonViewComp";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { RoleViewComp } from "../Role/RoleViewComp";
|
||||
import { BossViewComp } from "../Boss/BossViewComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -70,16 +74,37 @@ export class CardControllerComp extends CCComp {
|
||||
|
||||
do_minssion_victory(){
|
||||
this.node.getChildByName("victory").active=true
|
||||
this.to_mission()
|
||||
}
|
||||
|
||||
do_minssion_defeat(){
|
||||
this.node.getChildByName("defeat").active=true
|
||||
this.to_mission()
|
||||
}
|
||||
end_mission(){
|
||||
this.node.getChildByName("victory").active=false
|
||||
this.node.getChildByName("defeat").active=false
|
||||
console.log("end_mission")
|
||||
}
|
||||
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()
|
||||
}
|
||||
|
||||
}
|
||||
normal_call(){
|
||||
if(smc.vm_data.mission.coin >= smc.vm_data.mission.normal_cost){
|
||||
smc.vm_data.mission.coin -= smc.vm_data.mission.normal_cost
|
||||
@@ -199,6 +224,9 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
to_mission(){
|
||||
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
|
||||
|
||||
@@ -71,7 +71,7 @@ export class MapMonsterComp extends CCComp {
|
||||
this.mission_list = MonsetList[this.cur_mission]
|
||||
this.boss_list = BossList[this.cur_mission]
|
||||
// console.log("当前关卡方案",this.cur_mission,this.mission_list)
|
||||
this.refresh_timer= new Timer(smc.vm_data.shuaxin.max);
|
||||
this.refresh_timer= new Timer(smc.vm_data.mission.refresh_timer);
|
||||
smc.vm_data.mission.m_less=smc.vm_data.mission.m_alive=JSON.parse(JSON.stringify(this.total));
|
||||
}
|
||||
|
||||
@@ -242,7 +242,8 @@ export class MapMonsterComp extends CCComp {
|
||||
let b = ecs.getEntity<Boss>(Boss);
|
||||
let scale = -1
|
||||
b.load(pos,scale,bs[0],layer);
|
||||
}0
|
||||
}
|
||||
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
|
||||
@@ -157,7 +157,7 @@ export class MonViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
Reference in New Issue
Block a user