import { Vec2 } from "cc"; import GDefaultMode from "./default/GDefaultMode"; import { TB } from "../../../resources/config/data/schema"; import GRoleDefault from "../base/role/GRoleDefault"; import { _decorator } from "cc"; const { ccclass, property } = _decorator; //阵营守护 //玩家派兵攻击对方阵营 游戏参考 @ccclass('GCampGuardianMode') export default class GCampGuardianMode extends GDefaultMode<{},{}>{ //玩家水晶位置 playerPos: Vec2 = new Vec2(-400,0); //敌方水晶位置 enemyPos: Vec2 = new Vec2(400,0); onSyncInitSuccess(){ } // //生成宠物 // onGenRole(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 entity = role.getComponent(GRoleDefault); // //初始化 // entity.onInit(type,info,tactical,index); // //绑定寻敌 // entity.onQueryEunmy = () => { // return this.getEnumy(entity,type); // } // //绑定死亡回调 // entity.addKillBackEvent(this.onRoleKillBack.bind(this)) // //绑定受击回调 // entity.addHitCallback(this.onHitBack.bind(this)); // this.addGObject(entity,tactical.getPosition(index)); // this.getOnesRole(type).push(entity); // return entity; // } }