Exemple #1
0
 void Fire()
 {
     if (_ammoCount > 0 && !_isReloading)
     {
         for (int i = 0; i < BulletsPerShot; i++)
         {
             GameObject newBullet = Instantiate(Bullet, SpawnPoint);
             newBullet.transform.Rotate(Random.value * AccuracyError, Random.value * AccuracyError, 0);
             _particleSystem.Play();
         }
         WeaponUI.RemoveBullet();
         _ammoCount--;
         if (_ammoCount <= 0)
         {
             StartCoroutine(Reload());
         }
     }
 }