public IShipWeapon CreateWeaponFromData(ShipWeaponData data) { var spawnedWeapon = Object.Instantiate(data.Provider); spawnedWeapon.SetActive(false); var shipWeaponModel = new ShipWeaponModel( new ShipWeaponData() { Provider = spawnedWeapon, Bullet = data.Bullet, MaxAmmo = data.MaxAmmo, RateOfFire = data.RateOfFire, ReloadSpeed = data.ReloadSpeed, Force = data.Force }); GetShipWeapon = new ShipWeaponJammer(new ShipWeapon(shipWeaponModel, _bulletsPool)); return(GetShipWeapon); }
internal ShipWeaponModel(ShipWeaponData data) { _data = data; BulletStart = _data.Provider.transform; }
internal ShipWeaponFactory(ShipWeaponData data, IPool <GameObject> bulletsPool) { _data = data; _bulletsPool = bulletsPool; GetShipWeapon = CreateWeaponFromData(_data); }