import { _decorator, Component, instantiate, Node, SpriteFrame, Vec3 } from 'cc';
import { ModulerBase } from './ModulerBase';
import { resMgr } from '../../Frames/ResourcesMgr';
import { Bullet } from '../Bullet';
const { ccclass, property } = _decorator;

@ccclass('BulletMgr')
export class BulletMgr extends ModulerBase {

    createBullet(pos : Vec3, angle: number, frames: SpriteFrame[]){
        const bulletNode: Node = instantiate(resMgr.getPrefab("Bullet"));
        bulletNode.parent = this.node;
        bulletNode.getComponent(Bullet).init(pos, angle, frames);
        // bulletNode.setPosition(pos);
        // bulletNode.angle = angle;
    }
}


