mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update 添加松鼠角色
This commit is contained in:
@@ -5,11 +5,10 @@ import { Prefab } from "cc";
|
||||
import { instantiate } from "cc";
|
||||
import { Vec2 } from "cc";
|
||||
import GRolePVPEntity from "../base/role/PVP/GRolePVPEntity";
|
||||
import GRole, { GRoleUtil } from "../entity/GRole";
|
||||
import { GRoleUtil } from "../entity/GRole";
|
||||
import { TableGRole } from "../../../resources/config/ts/TableGRole";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
|
||||
//PVP 角色
|
||||
export enum GPVPModePlayerEnum{
|
||||
PLAYER, //玩家
|
||||
@@ -21,7 +20,7 @@ export interface GPVPModePlayerInfo{
|
||||
//阵法
|
||||
tactical: GTactical;
|
||||
//宠物列表
|
||||
roles: GRole[];
|
||||
roles: TableGRole[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,6 +53,7 @@ export default class GPVPMode extends GBaseMode<{}>{
|
||||
|
||||
|
||||
onSyncInitSuccess(): void {
|
||||
|
||||
|
||||
//初始化战斗
|
||||
console.log("GPVPMode 模式初始化");
|
||||
@@ -68,12 +68,14 @@ export default class GPVPMode extends GBaseMode<{}>{
|
||||
}
|
||||
|
||||
//生成角色
|
||||
onGenRole(type: GPVPModePlayerEnum,index:number,info:GRole) {
|
||||
onGenRole(type: GPVPModePlayerEnum,index:number,info:TableGRole) {
|
||||
|
||||
let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);
|
||||
if(!pos) return;
|
||||
let role = instantiate(this.rolePrefab);
|
||||
let entity = role.getComponent(GRolePVPEntity)
|
||||
let entity = role.getComponent(GRolePVPEntity);
|
||||
//绑定角色
|
||||
entity.type = type;
|
||||
entity.bind(info);
|
||||
//赋值阵容
|
||||
entity.ones = type;
|
||||
|
Reference in New Issue
Block a user