This commit is contained in:
PC-20230316NUNE\Administrator
2023-10-27 19:17:47 +08:00
parent 7e402432dd
commit c4e6d02388
20 changed files with 163 additions and 28 deletions

View File

@@ -1,10 +1,24 @@
import { Node } from "cc";
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import GRoleBase from "../role/GRoleBase";
import GAttackNormal from "./GAttackNormal";
import GAttackRemote from "./GAttackRemote";
import GAttackParabolicRemote from "./GAttackParabolicRemote";
import { UITransform } from "cc";
import GButtleBase from "../bullet/GButtleBase";
//攻击子弹类
export class GAttackBullet{
//创建子弹
static create<T extends GButtleBase<{}>>(GClass:{new():T},data:{}):T{
let bulletNode = new Node();
bulletNode.addComponent(UITransform);
let bullet = bulletNode.addComponent(GClass);
bullet.setData(data);
return bullet;
}
}
//攻击方式基类
export class GAttackBase{
@@ -12,8 +26,8 @@ export class GAttackBase{
}
//攻击方式
export const GAttack:{[key:string]:new () => GAttackBase} = {
export const GAttack:{[key:string]:(new () => GAttackBase)} = {
["Normal"]:GAttackNormal,
["Remote"]:GAttackRemote,
["ParabolicRemote"]:GAttackParabolicRemote,
}