mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
34 lines
955 B
TypeScript
34 lines
955 B
TypeScript
import GAttackNormal from "./GAttackNormal";
|
|
import GAttackParabolicBangRemote from "./GAttackParabolicBangRemote";
|
|
import { UITransform } from "cc";
|
|
import GButtleBase from "../bullet/GButtleBase";
|
|
import GRoleDefault from "../role/GRoleDefault";
|
|
import GNode from "../common/GNode";
|
|
import { TB } from "../../../config/data/schema";
|
|
|
|
//攻击子弹类
|
|
export class GAttackBullet{
|
|
|
|
//创建子弹
|
|
static create<T extends GButtleBase<{}>>(GClass:{new():T},data:{}):T{
|
|
let bulletNode = GNode.create();
|
|
bulletNode.addComponent(UITransform);
|
|
let bullet = bulletNode.addComponent(GClass);
|
|
bullet.setData(data);
|
|
return bullet;
|
|
}
|
|
|
|
}
|
|
|
|
//攻击方式基类
|
|
export interface GAttackBase{
|
|
attack(role:GRoleDefault,info:TB.TbGRoleAttack);
|
|
}
|
|
|
|
//攻击方式
|
|
export const GAttack:{[key:string]:(new () => GAttackBase)} = {
|
|
["Normal"]:GAttackNormal,
|
|
["ParabolicBangRemote"]:GAttackParabolicBangRemote,
|
|
}
|
|
|