dd
This commit is contained in:
@@ -73,6 +73,7 @@ export class MissionComp extends CCComp {
|
||||
mission_start(){
|
||||
/* todo 关卡设定完善*/
|
||||
console.log("mission_start Missions mons:",Missions[smc.mission.lv])
|
||||
smc.mission.status=1
|
||||
this.colose_victory()
|
||||
this.mission_init()
|
||||
// this.mskill_init()
|
||||
|
||||
@@ -2,8 +2,11 @@ import { _decorator, v3, Vec3 } 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 { BoxSet } from "../common/config/BoxSet";
|
||||
import { HeroSet } from "../common/config/heroSet";
|
||||
import { HeroList, HeroSet } from "../common/config/heroSet";
|
||||
import { Hero } from "../hero/Hero";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -11,13 +14,25 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('MissionHeroCompComp')
|
||||
@ecs.register('MissionHeroComp', false)
|
||||
export class MissionHeroCompComp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
timer:Timer=new Timer(2)
|
||||
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(smc.mission.status != 1) return
|
||||
if(this.timer.update(dt)){
|
||||
this.call_hero()
|
||||
}
|
||||
}
|
||||
call_hero(){
|
||||
this.timer.reset()
|
||||
let hero_list =HeroList
|
||||
let x=RandomManager.instance.getRandomInt(0,hero_list.length,1)
|
||||
let uuid=hero_list[x]
|
||||
console.log("call_hero",uuid)
|
||||
this.addHero(uuid)
|
||||
}
|
||||
|
||||
|
||||
/** 添加玩家 */
|
||||
private addHero(uuid:number=1001,i:number=0) {
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
|
||||
Reference in New Issue
Block a user