mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -10,6 +10,8 @@ import GRoleCGCrystal from "../base/role/CampGuardian/GRoleCGCrystal";
|
||||
import { TD } from "../../App";
|
||||
import { GTowards } from "../base/GObject";
|
||||
import GRoleBase from "../base/role/GRoleBase";
|
||||
import { GTactical } from "../entity/GTactical";
|
||||
import JNFrameTime from "../../../../extensions/ngame/assets/ngame/sync/frame/game/time/JNFrameTime";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//阵营守护 角色
|
||||
@@ -51,6 +53,11 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{
|
||||
this.onGenCrystal(GCampGuardianEnum.PLAYER);
|
||||
this.onGenCrystal(GCampGuardianEnum.ENEMY);
|
||||
|
||||
//定时器生成
|
||||
JNFrameTime.getInstance().setInterval(() => {
|
||||
// this.onGenRole(GCampGuardianEnum.PLAYER,TD.TbGRole.get());
|
||||
},1000)
|
||||
|
||||
}
|
||||
|
||||
//生成水晶
|
||||
@@ -72,35 +79,43 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{
|
||||
|
||||
}
|
||||
|
||||
// //生成宠物
|
||||
// onGenRole(type:GCampGuardianEnum,info:TB.TbGRole):GRoleDefault {
|
||||
//生成宠物
|
||||
onGenRole(type:GCampGuardianEnum,info:TB.TbGRole):GRoleDefault {
|
||||
|
||||
// let tactical = this.getInfo(type).tactical;
|
||||
// let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);
|
||||
// if(!pos) return;
|
||||
// let role = instantiate(this.rolePrefab);
|
||||
let tactical = GTactical.getTactical();
|
||||
let pos:Vec2;
|
||||
|
||||
switch(type){
|
||||
case GCampGuardianEnum.PLAYER:
|
||||
pos = tactical.getPosXYPosition(1,1,this.playerPos);
|
||||
break;
|
||||
case GCampGuardianEnum.ENEMY:
|
||||
pos = tactical.getPosXYPosition(1,1,this.enemyPos);
|
||||
break;
|
||||
}
|
||||
|
||||
// let entity = role.getComponent(GRoleDefault);
|
||||
// //初始化
|
||||
// entity.onInit(type,info,tactical,index);
|
||||
|
||||
// //绑定寻敌
|
||||
// entity.onQueryEunmy = () => {
|
||||
// return this.getEnumy(entity,type);
|
||||
// }
|
||||
if(!pos) return;
|
||||
let role = instantiate(this.petPrefab);
|
||||
|
||||
// //绑定死亡回调
|
||||
// entity.addKillBackEvent(this.onRoleKillBack.bind(this))
|
||||
// //绑定受击回调
|
||||
// entity.addHitCallback(this.onHitBack.bind(this));
|
||||
let entity = role.getComponent(GRoleDefault);
|
||||
//初始化
|
||||
entity.onInit(type,info,tactical,tactical.getPosXY(1,1));
|
||||
|
||||
// this.addGObject(entity,tactical.getPosition(index));
|
||||
// //绑定寻敌
|
||||
// entity.onQueryEunmy = () => {
|
||||
// return this.getEnumy(entity,type);
|
||||
// }
|
||||
|
||||
// this.getOnesRole(type).push(entity);
|
||||
// //绑定死亡回调
|
||||
// entity.addKillBackEvent(this.onRoleKillBack.bind(this))
|
||||
// //绑定受击回调
|
||||
// entity.addHitCallback(this.onHitBack.bind(this));
|
||||
|
||||
// return entity;
|
||||
this.addGObject(entity,pos);
|
||||
return entity;
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user