PC-20230316NUNE\Administrator c4e6d02388 update
2023-10-27 19:17:47 +08:00

34 lines
953 B
TypeScript

import { Node } from "cc";
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import GRoleBase from "../role/GRoleBase";
import GAttackNormal from "./GAttackNormal";
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{
attack(role:GRoleBase<{}>,info:TableGRoleAttack){};
}
//攻击方式
export const GAttack:{[key:string]:(new () => GAttackBase)} = {
["Normal"]:GAttackNormal,
["ParabolicRemote"]:GAttackParabolicRemote,
}