예제 #1
0
 public void Start()
 {
     Spaceship.TopAssaultWeapon             = AssaultWeaponFactory.GetWeapon <SpaceshipTopAssaultWeapon>(Spaceship.transform);
     Spaceship.TopAssaultWeapon.AttackType  = Spaceship.AttackType;
     Spaceship.TopAssaultWeapon.FireRate    = Spaceship.FireRate;
     Spaceship.TopAssaultWeapon.SpeedFactor = Spaceship.SpeedFactor;
 }
예제 #2
0
        private void UpdateTopAssaultWeapon()
        {
            if (Spaceship.TopAssaultWeapon != null && _ghostSpaceShip.TopAssaultWeapon == null)
            {
                _ghostSpaceShip.TopAssaultWeapon = AssaultWeaponFactory.GetWeapon <SpaceshipTopAssaultWeapon>(_ghostSpaceShip.transform, "GhostSpaceshipTopAssaultWeapon");
            }
            else if (Spaceship.TopAssaultWeapon == null && _ghostSpaceShip.TopAssaultWeapon != null)
            {
                GameObject.Destroy(_ghostSpaceShip.TopAssaultWeapon.gameObject);
            }

            if (_ghostSpaceShip != null)
            {
                _ghostSpaceShip.ChangeWeaponFireRates(Spaceship.FireRate);
                _ghostSpaceShip.ChangeWeaponAttackTypes(Spaceship.AttackType);
                _ghostSpaceShip.ChangeWeaponFireSpeedFactors(Spaceship.SpeedFactor);
            }
        }