import Sprite3D = Laya.Sprite3D;
import { Pool_Manager } from "./Pool_Manager";
import GameDefined from "../game_module/GameDefined";
import GameSceneController from "./GameSceneController";
export default class BulletController {
    private static instance: BulletController;
    public static get Instance(): BulletController {
        return this.instance || (this.instance = new BulletController());
    }
    private bulletPref: Sprite3D;
    public init(bullet: Sprite3D) {
        bullet.removeSelf();
        this.bulletPref = bullet;
        Pool_Manager.Instance.InitData(GameDefined.poolName.bullet, this.bulletPref);
    }

    private bullet: Sprite3D;
    public CreateBullet(): Sprite3D {
        //if (this.bullet) return this.bullet;
        var go = Pool_Manager.Instance.SetActiveObject(GameDefined.poolName.bullet);
        GameSceneController.Instance.game_scene.addChild(go);
       // this.bullet = go;
        return go;
    }

}