コード例 #1
0
 public override void Shoot(WeaponBehaviourScript weapon)
 {
     if (canShoot && weapon.CurrentMagazineAmmunition > 0)
     {
         weapon.StartCoroutine(WaitForShot(weapon));
         weapon.GetComponent <AudioSource>()?.PlayOneShot(weapon.WeaponData.ShootAudioClip);
     }
 }
コード例 #2
0
 public override void Reload(WeaponBehaviourScript weapon)
 {
     if (canReload && weapon.CurrentTotalAmmunition >= 1 && weapon.CurrentMagazineAmmunition < weapon.WeaponData.MagazineCapacity)
     {
         weapon.StartCoroutine(WaitForReload(weapon));
         weapon.GetComponent <AudioSource>()?.PlayOneShot(weapon.WeaponData.ReloadAudioClip);
     }
 }
コード例 #3
0
 public override void Shoot(WeaponBehaviourScript weapon)
 {
     if (canShoot && weapon.CurrentMagazineAmmunition >= 0)
     {
         canShoot = false;
         weapon.StartCoroutine(WaitForShot(weapon));
     }
 }