update 添加松鼠角色

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-10-30 02:34:11 +08:00
parent ca84f38096
commit bb4334c0ff
178 changed files with 6352 additions and 195 deletions

View File

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