예제 #1
0
        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);
        }
예제 #2
0
 internal ShipWeaponModel(ShipWeaponData data)
 {
     _data       = data;
     BulletStart = _data.Provider.transform;
 }
예제 #3
0
 internal ShipWeaponFactory(ShipWeaponData data, IPool <GameObject> bulletsPool)
 {
     _data         = data;
     _bulletsPool  = bulletsPool;
     GetShipWeapon = CreateWeaponFromData(_data);
 }