mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
更新
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "54542374-5643-4a8a-bc84-142a621621ed",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "6d1e9fb6-4004-4dd9-b0fc-37c6ef6d490f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
import { _decorator } from "cc";
|
||||
import GFSMDefault from "../../fsm/Default/GFSMDefault";
|
||||
import { GFSMDefaultAnim } from "../../fsm/Default/GFSMDefaultAnim";
|
||||
import { GFSMAnimBase } from "../../fsm/GFSMAnimBase";
|
||||
import GFSMBase from "../../fsm/GFSMBase";
|
||||
import GRoleBase from "../GRoleBase";
|
||||
import { ProgressBar } from "cc";
|
||||
const { property,ccclass } = _decorator;
|
||||
|
||||
//阵营守护 水晶
|
||||
@ccclass('GRoleCGCrystal')
|
||||
export default class GRoleCGCrystal extends GRoleBase<{}>{
|
||||
|
||||
@property(ProgressBar)
|
||||
bloodVolume:ProgressBar;
|
||||
|
||||
protected fsmCreate(): GFSMBase {
|
||||
return new GFSMBase();
|
||||
}
|
||||
protected fsmAnimCreate(): GFSMDefaultAnim {
|
||||
return new GFSMDefaultAnim(this.spine);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "bff723b7-dcb6-4a90-9a89-e221a756bf1f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -98,7 +98,7 @@ export default abstract class GRoleBase<T> extends GObject<T>{
|
||||
}
|
||||
|
||||
//初始化
|
||||
protected init(role:TB.TbGRole){
|
||||
public init(role:TB.TbGRole){
|
||||
console.log("初始化宠物",!!this.spine,!!(app.battleRes.getRoleSpine(role.id)));
|
||||
this.spine.skeletonData = app.battleRes.getRoleSpine(role.id);
|
||||
}
|
||||
|
@@ -3,29 +3,77 @@ import GDefaultMode from "./default/GDefaultMode";
|
||||
import { TB } from "../../../resources/config/data/schema";
|
||||
import GRoleDefault from "../base/role/GRoleDefault";
|
||||
import { _decorator } from "cc";
|
||||
import GBaseMode from "../GBaseMode";
|
||||
import { Prefab } from "cc";
|
||||
import { instantiate } from "cc";
|
||||
import GRoleCGCrystal from "../base/role/CampGuardian/GRoleCGCrystal";
|
||||
import { TD } from "../../App";
|
||||
import { GTowards } from "../base/GObject";
|
||||
import GRoleBase from "../base/role/GRoleBase";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//阵营守护 角色
|
||||
export enum GCampGuardianEnum{
|
||||
PLAYER, //玩家
|
||||
ENEMY, //敌人
|
||||
}
|
||||
|
||||
//阵营守护
|
||||
//玩家派兵攻击对方阵营 游戏参考
|
||||
@ccclass('GCampGuardianMode')
|
||||
export default class GCampGuardianMode extends GDefaultMode<{},{}>{
|
||||
export default class GCampGuardianMode extends GBaseMode<{},{}>{
|
||||
|
||||
//玩家水晶位置
|
||||
playerPos: Vec2 = new Vec2(-400,0);
|
||||
playerPos: Vec2 = new Vec2(-600,0);
|
||||
//敌方水晶位置
|
||||
enemyPos: Vec2 = new Vec2(400,0);
|
||||
enemyPos: Vec2 = new Vec2(600,0);
|
||||
|
||||
//我方水晶
|
||||
|
||||
//敌方水晶
|
||||
|
||||
//水晶预制体
|
||||
@property(Prefab)
|
||||
crystalPrefab: Prefab;
|
||||
|
||||
//角色预制体
|
||||
@property(Prefab)
|
||||
petPrefab: Prefab;
|
||||
|
||||
//玩家宠物
|
||||
playerRoles: GRoleBase<{}>[] = [];
|
||||
//敌方宠物
|
||||
enemyRoles: GRoleBase<{}>[] = [];
|
||||
|
||||
onSyncInitSuccess(){
|
||||
|
||||
|
||||
//生成水晶
|
||||
this.onGenCrystal(GCampGuardianEnum.PLAYER);
|
||||
this.onGenCrystal(GCampGuardianEnum.ENEMY);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//生成水晶
|
||||
onGenCrystal(type:GCampGuardianEnum){
|
||||
|
||||
let crystalNode = instantiate(this.crystalPrefab);
|
||||
let crystal = crystalNode.getComponent(GRoleCGCrystal);
|
||||
crystal.init(TD.TbGRole.get(10005));
|
||||
|
||||
switch(type){
|
||||
case GCampGuardianEnum.PLAYER:
|
||||
this.addGObject(crystal,this.playerPos)
|
||||
break;
|
||||
case GCampGuardianEnum.ENEMY:
|
||||
crystal.setTowards(GTowards.LEFT)
|
||||
this.addGObject(crystal,this.enemyPos)
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// //生成宠物
|
||||
// onGenRole(info:TB.TbGRole):GRoleDefault {
|
||||
// onGenRole(type:GCampGuardianEnum,info:TB.TbGRole):GRoleDefault {
|
||||
|
||||
// let tactical = this.getInfo(type).tactical;
|
||||
// let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);
|
||||
|
Reference in New Issue
Block a user