提交地图

This commit is contained in:
PC-20230316NUNE\Administrator
2023-12-23 19:00:53 +08:00
parent d66f08455e
commit 516d520c5e
38 changed files with 3020 additions and 287 deletions

View File

@@ -7,7 +7,7 @@ import GBaseMode from "../GBaseMode";
import { Prefab } from "cc";
import { instantiate } from "cc";
import GRoleCGCrystal from "../base/role/CampGuardian/GRoleCGCrystal";
import { TD } from "../../App";
import { TD, app } from "../../App";
import { GTowards } from "../base/GObject";
import GRoleBase from "../base/role/GRoleBase";
import { GTactical } from "../entity/GTactical";
@@ -16,6 +16,8 @@ import { TbGPetId } from "../../config/TbGPet";
import GModeTools from "./GModeTools";
import GPetAttribute from "../base/values/attribute/role/GPetAttribute";
import RandomUtil from "../../../../extensions/ngame/assets/ngame/util/RandomUtil";
import { GModeEvent } from "./GMode";
import { Camera } from "cc";
const { ccclass, property } = _decorator;
//阵营守护 角色
@@ -51,6 +53,10 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{
//敌方宠物
enemyRoles: GRoleBase<{}>[] = [];
//模式相机
@property(Camera)
modeCamera:Camera;
onSyncInitSuccess(){
//生成水晶
@@ -127,8 +133,8 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{
petStar:0,
petStarExp:0,
}));
// //绑定受击回调
// entity.addHitCallback(this.onHitBack.bind(this));
//绑定受击回调
entity.addHitCallback(this.onHitBack.bind(this));
this.addGObject(entity,pos);
this.getOnesRole(type).push(entity);
@@ -158,6 +164,22 @@ export default class GCampGuardianMode extends GBaseMode<{},{}>{
},3000)
}
//角色受击回调
onHitBack(role:GRoleDefault,hit:number){
if(!role.get()) return;
//添加受击显示
app.event.emit(GModeEvent.HIT,{
mode:this,
role:role,
hit:hit,
world:role.v2World,
camera:this.modeCamera,
});
}
}