Inheritance: MonoBehaviour
Beispiel #1
0
 public void ShootSG()
 {
     if (bulletSG > 4)
     {
         shotCounter -= Time.deltaTime;
         if (isFiring)
         {
             if (shotCounter <= 0)
             {
                 bulletSG   -= 5;
                 shotCounter = timeBetweenShots;
                 //for(bulletMovement newBullet1 = Instantiate (bullet, fpSG (i) .position, fpSG1.rotation) as bulletMovement;)
                 bulletMovement newBullet1 = Instantiate(bullet, fpSG1.position, fpSG1.rotation) as bulletMovement;
                 bulletMovement newBullet2 = Instantiate(bullet, fpSG2.position, fpSG2.rotation) as bulletMovement;
                 bulletMovement newBullet3 = Instantiate(bullet, fpSG3.position, fpSG3.rotation) as bulletMovement;
                 bulletMovement newBullet4 = Instantiate(bullet, fpSG4.position, fpSG4.rotation) as bulletMovement;
                 bulletMovement newBullet5 = Instantiate(bullet, fpSG5.position, fpSG5.rotation) as bulletMovement;
                 newBullet1.damageToGive = gunDMG;
                 newBullet1.speed        = bulletSpeed;
                 newBullet2.damageToGive = gunDMG;
                 newBullet2.speed        = bulletSpeed;
                 newBullet3.damageToGive = gunDMG;
                 newBullet3.speed        = bulletSpeed;
                 newBullet4.damageToGive = gunDMG;
                 newBullet4.speed        = bulletSpeed;
                 newBullet5.damageToGive = gunDMG;
                 newBullet5.speed        = bulletSpeed;
             }
         }
     }
 }
Beispiel #2
0
 public void ShootAK()
 {
     if (bulletAK != 0)
     {
         shotCounter -= Time.deltaTime;
         if (isFiring)
         {
             if (shotCounter <= 0)
             {
                 bulletAK   -= 1;
                 shotCounter = timeBetweenShots;
                 bulletMovement newBullet = Instantiate(bullet, fpAK.position, fpAK.rotation) as bulletMovement;
                 newBullet.damageToGive = gunDMG;
                 newBullet.speed        = bulletSpeed;
             }
         }
     }
 }