diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index bc51dbe3..f023b441 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -32,8 +32,8 @@ import { Component } from "cc"; // let WsPath = `ws://localhost:8080/websocket` // let APIPath = `http://192.168.1.23:8080` // let WsPath = `ws://192.168.1.23:8080/websocket` -let APIPath = `http://192.168.0.128:8080` -let WsPath = `ws://192.168.0.128:8080/websocket` +let APIPath = `http://192.168.0.125:8080` +let WsPath = `ws://192.168.0.125:8080/websocket` // let APIPath = `https://api.pet.jisol.cn` // let WsPath = `wss://api.pet.jisol.cn/websocket` diff --git a/JisolGameCocos/assets/script/battle/entity/GRole.ts b/JisolGameCocos/assets/script/battle/entity/GRole.ts index 189ff3f5..32baa3cb 100644 --- a/JisolGameCocos/assets/script/battle/entity/GRole.ts +++ b/JisolGameCocos/assets/script/battle/entity/GRole.ts @@ -6,7 +6,7 @@ import GRoleBase from "../base/role/GRoleBase"; export class GRoleUtil{ //获取存活的玩家 如果不存活则返回 null - static get>(player:T):() => T{ + static get>(player:T):() => T{ if(!player) return null; return ():T => { if(player) diff --git a/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts b/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts index e1321943..fd1422c7 100644 --- a/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GCampGuardianMode.ts @@ -2,14 +2,17 @@ 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); @@ -19,33 +22,35 @@ export default class GCampGuardianMode extends GDefaultMode<{},{}>{ } + + // //生成宠物 // 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 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); + // let entity = role.getComponent(GRoleDefault); + // //初始化 + // entity.onInit(type,info,tactical,index); - // // //绑定寻敌 - // // entity.onQueryEunmy = () => { - // // return this.getEnumy(entity,type); - // // } + // //绑定寻敌 + // entity.onQueryEunmy = () => { + // return this.getEnumy(entity,type); + // } - // // //绑定死亡回调 - // // entity.addKillBackEvent(this.onRoleKillBack.bind(this)) - // // //绑定受击回调 - // // entity.addHitCallback(this.onHitBack.bind(this)); + // //绑定死亡回调 + // entity.addKillBackEvent(this.onRoleKillBack.bind(this)) + // //绑定受击回调 + // entity.addHitCallback(this.onHitBack.bind(this)); - // // this.addGObject(entity,tactical.getPosition(index)); + // this.addGObject(entity,tactical.getPosition(index)); - // // this.getOnesRole(type).push(entity); + // this.getOnesRole(type).push(entity); - // // return entity; + // return entity; // }