This commit is contained in:
PC-20230316NUNE\Administrator 2023-12-11 10:42:36 +08:00
parent 24a498a712
commit f99f10e237
3 changed files with 27 additions and 22 deletions

View File

@ -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`

View File

@ -6,7 +6,7 @@ import GRoleBase from "../base/role/GRoleBase";
export class GRoleUtil{
//获取存活的玩家 如果不存活则返回 null
static get<T extends GRoleBase<{}>>(player:T):() => T{
static get<T extends GRoleBase<{}>>(player:T):() => T{
if(!player) return null;
return ():T => {
if(player)

View File

@ -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;
// }