Exemple #1
0
 /* public void displayBullet()
  * {
  *   int currentbullet = weapon.GetBulletNum();
  *   bulletText.text = currentbullet.ToString();
  *   Debug.Log("", bulletText);
  *
  * }*/
 private void shoot()
 {
     if (weapon.GetBulletNum() > 0)
     {
         weapon.costBullet();
         RaycastHit hit;
         if (Physics.Raycast(FPS.transform.position, FPS.transform.forward, out hit, range))
         {
             HitEffect(hit);
             Debug.Log(" " + hit.transform.name);
             enemy target = hit.transform.GetComponent <enemy>();
             target.damage(damage);
         }
         else
         {
             return;
         }
     }
 }